gdb-8.2.1 build failed on macos 10.11.6

Chris Johns chrisj at rtems.org
Mon Apr 22 02:16:34 UTC 2019


On 20/4/19 3:58 am, Juan Rafael García Blanco wrote:
> Hi,
> 
> I have found an error while trying to build the RTEMS 5 toolset with RSB. The build process stops during compilation of gdb with the following error message:
> 
> ../../gdb-8.2.1/gdb/tui/tui-hooks.c:208:36: error: default initialization of an object of const type 'const gdb::observers::token' without a user-provided default constructor
> static const gdb::observers::token tui_observers_token;
>                                    ^
>                                                       {}
> 1 error generated.

I have just built am ARM tool chain for RTEMS 5 using the RSB master on the
latest MacOS (10.14.4 (18E226)) with the latest Xcode (Version 10.2.1
(10E1001)). I did not see an error. I am currently building a sparc tool chain
and gdb has built without error.

My machine is only MacOS and Xcode.

> The selected compiler is /usr/bin/cc (BTW, I have not found a way to tell RSB to use a different host compiler), 

You can customise what happens for Macos here:

https://git.rtems.org/rtems-source-builder/tree/source-builder/sb/darwin.py

I am assuming you have some Macport packages installed because you have
referenced a Macport ticket. Is this true?

> which in my case is:
> 
> Apple LLVM version 8.0.0 (clang-800.0.42.1)
> Target: x86_64-apple-darwin15.6.0
> 
> I think this same problem has also been found in the macports project [0].
> 
> I see the __cc variable is overridden for darwin hosts version 13 and above. I’m running darwin 15.6.0, which apparently supports Xcode 8.2.1. This version includes both /usr/bin/cc, which is a link to /usr/bin/clang; and /usr/bin/gcc. 

This is what I have.

> They might have been installed as part of the so-called Xcode’s command line tools… 

They should be.

> In any case, both cc and gcc seem to be based on LLVM 8; thus, I think we can say there is no compiler suitable for building gdb in Xcode 8.2.1, which is the latest version available for darwin 15.6.0.

I have:

$ which cc
/usr/bin/cc
$ cc --version
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.5.0
Thread model: posix
InstalledDir:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
$ ls -las /usr/bin/cc
0 lrwxr-xr-x  1 root  wheel  5 27 Sep  2018 /usr/bin/cc -> clang
mohua:rtems chris$ ls -las /usr/bin/gcc
16 -rwxr-xr-x  1 root  wheel  18288 21 Mar 17:08 /usr/bin/gcc
$ /usr/bin/gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr
--with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.5.0
Thread model: posix
InstalledDir:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

These are the Xcode tools.

> I’m willing to help fixing this, but I do not know what would be the proper way to handle this. I guess RSB should warn the user and require GCC or another version of LLVM.

If there is a Macports package installed a library maybe changing how gdb is
built and as a result it exposes some code that needs to be fixed?

My configure command line for gdb is:

../gdb-8.2.1/configure --build=x86_64-apple-darwin18.5.0
--host=x86_64-apple-darwin18.5.0 --target=arm-rtems5 --verbose --disable-nls
--disable-gas --disable-binutils --disable-ld --disable-gold --disable-gprof
--without-included-gettext --disable-win32-registry --disable-werror
--enable-sim --without-zlib --with-expat --with-guile=no
--with-python=/usr/bin/python --prefix=/opt/work/rtems/5
--bindir=/opt/work/rtems/5/bin --exec-prefix=/opt/work/rtems/5
--includedir=/opt/work/rtems/5/include --libdir=/opt/work/rtems/5/lib
--mandir=/opt/work/rtems/5/share/man --infodir=/opt/work/rtems/5/share/info

I have uploaded the build output...

 https://ftp.rtems.org/pub/rtems/people/chrisj/source-builder/5-arm.txt

Maybe you can spot something in the output of gdb's configure stage that is
different?

Chris

> [0] https://trac.macports.org/ticket/57877#no2



More information about the users mailing list