CXXFLAGS and the gold linker
Adam Jensen
hanzer at riseup.net
Tue Sep 30 07:45:54 PDT 2014
I sometimes get an [error][1] during "make crossworld" depending on the
value of "CXXFLAGS" set in "/etc/make.conf".
[1]: "
===> gnu/usr.bin/binutils224/libgold
===> gnu/usr.bin/binutils224/gold
install -C -s -o root -g wheel -m 555 ld.gold \
/usr/obj/usr/src/ctools_i386_i386/usr/libexec/binutils224/elf
*** Error code 71
Stop.
make[4]: stopped in /usr/src/gnu/usr.bin/binutils224/gold
*** Error code 1
"
Following the example "make.conf" file, available in
"/etc/defaults" (and "/usr/share/examples/etc/defaults"),
I put together a little script that would construct an "/etc/make.conf"
with several different values for "CXXFLAGS" and then "make crossworld".
I let it run last night (just goofing off) and got this:
| For every run, "/etc/make.conf" contains: |
|-------------------------------------------|
| git_UNSET=CONTRIB PERL DIALOG |
| STRIP= -s |
| INSTALL= install -C |
| THREAD_LIB?= thread_xu |
| STATIC_LOCALES= UTF8 |
| GROFF_PAPER_SIZE= letter |
| PRINTERDEVICE= ascii |
| DOC_LANG= en_US.ISO8859-1 |
| CPUTYPE= k7 |
| CFLAGS= -O -pipe |
| COPTFLAGS= -O -pipe |
|-------------------------------------------|
| When "/etc/make.conf" also contains: | "make crossworld" ends with: |
|--------------------------------------+------------------------------|
| CXXFLAGS+= -fmemoize-lookups \ | [Error][1] |
| -fsave-memoized | |
|--------------------------------------+------------------------------|
| CXXFLAGS= -fmemoize-lookups \ | [Error][1] |
| -fsave-memoized | |
|--------------------------------------+------------------------------|
| No "CXXFLAGS" entry | Success |
|--------------------------------------+------------------------------|
| CXXFLAGS+= -O -pipe | Success |
|--------------------------------------+------------------------------|
| CXXFLAGS= -O -pipe | [Error][1] |
|--------------------------------------+------------------------------|
There were additional runs with "LDVER" and "WORLD_LDVER" explicitly set
to either "ld.bfd" or "ld.gold" - this made no difference in the success
or failure of the build.
I'm not sure what to make of this. For the short term, it might be nice
to have a "NO_GOLD=true" option that can be set in "/etc/make.conf" to
avoid building the gold linker altogether.
More information about the Users
mailing list