[odb-users] Strange Problems Building ODB Compiler From Source

Brian Coggins becoggins at hotmail.com
Wed Mar 20 10:43:55 EDT 2019


Also, if you want to try and debug this, the relevant place to look is
odb-gcc-8/odb-2.5.0-b.13/buildfile, lines that reference gxx_name. You
could, for example, try to print the host/target triplets by adding the
following lines:

info $cxx.target
info $build.host

This gets us partway.  Here's the code from the buildfile as modified (actually odb-gcc-8/odb-2.5.0-b.13/odb/buildfile):

# Unless cross-compiling, pass the C++ compiler's recall path as g++ name. At
# some point we should also make it configurable.
#
gxx_name = ($cxx.target != $build.host ? g++ : $recall($cxx.path))
gxx_name = $regex.replace($gxx_name, '\\', '\\\\') # Escape back slashes.

# ADDED FOR DEBUG
info $cxx.target
info $build.host

And here's the output:

odb/buildfile:43:1: info: x86_64-apple-darwin17.3.0
  info: while applying rule alias to update dir{./}
odb/buildfile:44:1: info: x86_64-apple-darwin17.7.0
  info: while applying rule alias to update dir{./}

That ought to be enough to throw it over to g++ rather than g++-8.  Not sure why it is reading different platform versions in those two variables.  In case it helps, I ran b --verbose=5 and saved the output to a text file on Dropbox at the following link.  That was from before I made the change to the buildfile.

https://www.dropbox.com/s/mjus5uu9iwntjnn/odb_build_log.txt?raw=1

Thanks,
Brian

________________________________
From: Boris Kolpackov <boris at codesynthesis.com>
Sent: Wednesday, March 20, 2019 9:27 AM
To: Brian Coggins
Cc: odb-users at codesynthesis.com
Subject: Re: [odb-users] Strange Problems Building ODB Compiler From Source

Brian Coggins <becoggins at hotmail.com> writes:

> $ odb --database sqlite test.h
>
> clang: error: unknown argument: '-fplugin-arg-odb-svc-path=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1'

Ok, this suggests that for some reason ODB is using g++ instead of
g++-8. On Mac OS g++ is an alias for clang++.

Now we need to understand why. Could you run the following for me
and send the beginning of the output (or upload the whole log
somewhere):

$ cd odb-gcc-8/odb-2.5.0-b.13
$ b clean
$ b --verbose=5

I am particularly interested in these lines (shown with values from
my Linux box):

trace: reset: original host: 'x86_64-linux-gnu'
trace: reset: canonical host: 'x86_64-linux-gnu'; class: linux

cxx ...
  cxx        g++-7@/usr/bin/g++-7
  id         gcc
  version    7.2.0 (Ubuntu 7.2.0-1ubuntu1~16.04)
  ...
  target     x86_64-linux-gnu

As well as the g++ compilation command line that shows the -DODB_GXX_NAME
option.

Also, if you want to try and debug this, the relevant place to look is
odb-gcc-8/odb-2.5.0-b.13/buildfile, lines that reference gxx_name. You
could, for example, try to print the host/target triplets by adding the
following lines:

info $cxx.target
info $build.host


More information about the odb-users mailing list