Opened 5 years ago

Last modified 9 months ago

#47929 new defect

llvm-gcc42 @2336.11_2 fails building on 10.6.8

Reported by: udbraumann Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.3.3
Keywords: Cc: jeremyhu (Jeremy Huddleston Sequoia), larryv (Lawrence Velázquez), ryandesign (Ryan Schmidt), kencu (Ken)
Port: llvm-gcc42

Description

While updating llvm-gcc42 from 2336.11_1 to 2336.11_2 on 10.6.8 I was surprised to run into trouble like dyld: lazy symbol binding failed: Symbol not found: _strncmp. BTW, I am wondering that llvm-gcc42 itself is being automatically selected for building.

Below is the most relevant excerpt. I am hesitating to directly report to http://developer.apple.com/bugreporter

...
:info:build /usr/bin/llvm-gcc-4.2 -pipe -std=gnu89 -c -g -std=gnu89 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -mdynamic-no-pic -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild -I/opt/local/var/macports/build
/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_llvm-gcc42/llvm-gcc42/work/objroot/src/gcc -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_llvm-gcc42/llvm-gcc42/work/objroot/src/gcc/build -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_llvm-gcc42/llvm-gcc42/work/objroot/src/gcc/../include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_llvm-gcc42/llvm-gcc42/work/objroot/src/gcc/../libcpp/include  -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_llvm-gcc42/llvm-gcc42/work/objroot/src/gcc/../libdecnumber -I../libdecnumber -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_llvm-gcc42/llvm-gcc42/work/objroot/dst-llvmCore/Developer/usr/local/include -DENABLE_LLVM -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_llvm-gcc42/llvm-gcc42/work/objroot/dst-llvmCore/Developer/usr/local/include  -DNDEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS
-D__STDC_CONSTANT_MACROS -DLLVM_VERSION_INFO='"2336.11"' -DBUILD_LLVM_APPLE_STYLE   -o build/gencondmd.o build/gencondmd.c
:info:build dyld: lazy symbol binding failed: Symbol not found: _strncmp
:info:build   Referenced from: /usr/llvm-gcc-4.2/bin/../libexec/gcc/i686-apple-darwin10/4.2.1/cc1
:info:build   Expected in: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_llvm-gcc42/llvm-gcc42/work/objroot/obj-x86_64-x86_64/./gcc/libllvmgcc.dylib
:info:build
:info:build dyld: Symbol not found: _strncmp
:info:build   Referenced from: /usr/llvm-gcc-4.2/bin/../libexec/gcc/i686-apple-darwin10/4.2.1/cc1
:info:build   Expected in: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_llvm-gcc42/llvm-gcc42/work/objroot/obj-x86_64-x86_64/./gcc/libllvmgcc.dylib
:info:build
:info:build Stack dump:
:info:build 0.  Program arguments: /usr/llvm-gcc-4.2/bin/../libexec/gcc/i686-apple-darwin10/4.2.1/cc1 -quiet -I. -Ibuild -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_llvm-gcc42/llvm-gcc42/work/objroot/src/gcc -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_llvm-gcc42/llvm-gcc42/work/objroot/src/gcc/build -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_llvm-gcc42/llvm-gcc42/work/objroot/src/gcc/../include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_llvm-gcc42/llvm-gcc42/work/objroot/src/gcc/../libcpp/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_llvm-gcc42/llvm-gcc42/work/objroot/src/gcc/../libdecnumber -I../libdecnumber -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_llvm-gcc42/llvm-gcc42/work/objroot/dst-llvmCore/Developer/usr/local/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_llvm-gcc42/llvm-gcc42/work/objroot/dst-llvmCore/Developer/usr/local/include -imultilib x86_64 -iprefix /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin10/4.2.1/ -D__DYNAMIC__ -DIN_GCC -DHAVE_CONFIG_H -DGENERATOR_FILE -DENABLE_LLVM -DNDEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DLLVM_VERSION_INFO="2336.11" -DBUILD_LLVM_APPLE_STYLE build/gencondmd.c -feliminate-unused-debug-symbols -quiet -dumpbase gencondmd.c -mmacosx-version-min=10.6 -mdynamic-no-pic -m64 -mtune=core2 -auxbase-strip build/gencondmd.o -g -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -std=gnu89 -std=gnu89 -o -
:info:build i686-apple-darwin10-llvm-gcc-4.2: Internal error: Segmentation fault (program cc1)
:info:build Please submit a full bug report.
:info:build See <URL:http://developer.apple.com/bugreporter> for instructions.
:info:build make[5]: *** [build/gencondmd.o] Error 1
:info:build rm fsf-funding.pod gcov.pod gfdl.pod cpp.pod gpl.pod gcc.pod
:info:build make[4]: *** [all-stage1-gcc] Error 2
:info:build make[3]: *** [stage1-bubble] Error 2
:info:build make[2]: *** [all] Error 2
:info:build + exit 1
:info:build make[1]: *** [llvmgcc42] Error 1
...

Attachments (2)

main.log.gz (80.6 KB) - added by udbraumann 5 years ago.
main_DYLD.log.gz (3.2 MB) - added by udbraumann 5 years ago.

Change History (19)

Changed 5 years ago by udbraumann

Attachment: main.log.gz added

comment:1 in reply to:  description Changed 5 years ago by ryandesign (Ryan Schmidt)

Cc: ryandesign@… added
Keywords: Symbol not found: _strncmp removed

Replying to braumann@…:

While updating llvm-gcc42 from 2336.11_1 to 2336.11_2 on 10.6.8 I was surprised to run into trouble like dyld: lazy symbol binding failed: Symbol not found: _strncmp.

Hmm. Yesterday's update of llvm-gcc42 was done for the benefit of Yosemite, on which llvm-gcc42 couldn't be built until now. It's certainly possible this has introduced problems for earlier platforms, though this was not intended.

BTW, I am wondering that llvm-gcc42 itself is being automatically selected for building.

Well, the llvm-gcc42 port will not build using a compiler installed by an already-installed llvm-gcc42 port. What you're seeing in the log is that the llvm-gcc42 port is being compiled using the version of the llvm-gcc42 compiler that came with Xcode.

Theoretically, that should work. However, on my Snow Leopard system, Xcode gcc42 is used, not llvm-gcc42, and I don't see anything in the llvm-gcc42 portfile that would explain why Xcode llvm-gcc42 was selected instead on your system.

Do you really need MacPorts llvm-gcc42? Is the version provided by Xcode not sufficient for your needs? It is true that the MacPorts version is ever so slightly newer than the version provided by Xcode, but there are only a few small differences.

Below is the most relevant excerpt. I am hesitating to directly report to http://developer.apple.com/bugreporter

You're probably right not to report this to Apple; they've moved on from llvm-gcc. We keep it around mainly for the benefit of very old software that has not yet been fixed to compile properly with clang on newer systems.

comment:2 Changed 5 years ago by ryandesign (Ryan Schmidt)

Looking more closely at the error, it is wrong (and surely the cause of the error message) that Xcode llvm-gcc42 is trying to load a library that was just built for MacPorts llvm-gcc42, but that can probably be explained by the build system setting DYLD_LIBRARY_PATH to its own build directory. I see in the log that the configure script determined that DYLD_LIBRARY_PATH could be used, and setting it to a build directory will have the effect of any program using the libraries in that directory instead of wherever the program was configured to look for them normally. We could simply blacklist Xcode llvm-gcc42 as well, and MacPorts will move on to the next-best compiler.

As to why MacPorts didn't use Xcode gcc42 on your system as it did on mine: the only explanation I can come up with is that you might be using Xcode 4.2, which does not include gcc42. Is that the case?

comment:3 in reply to:  2 Changed 5 years ago by udbraumann

Indeed, I have installed Xcode 4.2 some time ago. Originally, I had Xcode 3.2.6. Xcode 4.2 is the highest Xcode version running on 10.6.8. I was not aware that installing Xcode 4.2 influences preferences for compiler selection inside MP.

comment:4 Changed 5 years ago by ryandesign (Ryan Schmidt)

Yes, it does. With Xcode 3.1.x and 3.2.x on Snow Leopard, the default compiler is Apple gcc42. In Xcode 4.x, the default compiler is llvm-gcc42. In Xcode 4.2, Apple removed gcc42. Because Xcode 4 on Snow Leopard was paid software, much fewer users use it, so problems like this come up much more often, which is why we recommend using Xcode 3.2.6 on Snow Leopard, unless you have some other reason to need Xcode 4.2.

But I do intend to fix this. My Snow Leopard machine is currently busy building llvm-gcc42 with Xcode gcc42 to verify that works. Then I'll retry with Xcode llvm-gcc42 to verify that fails. Then I'll retry after blacklisting Xcode llvm-gcc42 to see what compiler it picks and if it builds ok.

comment:5 in reply to:  4 Changed 5 years ago by udbraumann

I was uninstalling llvm-gcc42 @2336.11_1 in order to see if the llvm-gcc42 @2336.11_2 building problems were due to some interference between llvm-gcc42 @2336.11_1 and the Xcode 4.2-shipped llvm-gcc42 @2336.1.00. However, the latter failed building llvm-gcc42 @2336.11_2 with the same error as reported above: dyld: lazy symbol binding failed: Symbol not found: _strncmp.

comment:6 Changed 5 years ago by ryandesign (Ryan Schmidt)

I was not able to reproduce the issue on my Snow Leopard machine.

comment:7 Changed 5 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Reproducing with DYLD_PRINT_ENV=1 DYLD_PRINT_LIBRARIES=1 in the environment might give some helpful information to see what's going on.

comment:8 Changed 5 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Also note that '/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin10/4.2.1/cc1' is from CLTools and not in Xcode proper. Please report the output of:

otool -l /usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin10/4.2.1/cc1 | grep uuid

As that will help identifiy which version of CLTools you have installed.

comment:9 in reply to:  8 Changed 5 years ago by udbraumann

$ otool -l /usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin10/4.2.1/cc1 | grep uuid
    uuid F108C664-F90E-3B30-AEF9-A31D0C17F292

I will activate the two environment variables and than will post the main.log again.

comment:10 Changed 5 years ago by jeremyhu (Jeremy Huddleston Sequoia)

And what version of CLTools do you think that is from? What's the output of '/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin10/4.2.1/cc1 --version' ?

comment:11 in reply to:  10 Changed 5 years ago by udbraumann

$ /usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin10/4.2.1/cc1 --version
GNU C version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00) (i686-apple-darwin10)
	compiled by GNU C version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00).
GGC heuristics: --param ggc-min-expand=150 --param ggc-min-heapsize=65536

comment:12 in reply to:  10 Changed 5 years ago by udbraumann

Setting DYLD_PRINT_ENV=1 and DYLD_PRINT_LIBRARIES=1, though making my console verbose, apparently had no effect on main.log or the console during my build attempts using the XCode 4.2 shipped llvm-gcc-42 to build macports-llvm-gcc-4.2. I always end up with the problem I have pasted above.

For the moment I give up an simply build macports-llvm-gcc-42 (i.e. llvm-gcc42 @2336.11_2) using gcc-42 from XCode 3.2.6:

$ sudo port install llvm-gcc42 configure.compiler=gcc-4.2

comment:13 Changed 5 years ago by jeremyhu (Jeremy Huddleston Sequoia)

How did you set the envvar? You need to set those envvars in the environment that spawns /usr/bin/llvm-gcc-4.2. I'd suggest setting it in build.env. Is that what failed?

though making my console verbose, apparently had no effect on main.log or the console

Those statements are contradictory. You say it had no effect on the console and that it made the console output more verbose. Which is it? Did it makes the output more verbose? If so, please show me the requested output from the failed execution.

comment:14 in reply to:  13 ; Changed 5 years ago by udbraumann

Sorry for the confusion, I put the

export DYLD_PRINT_ENV=1
export DYLD_PRINT_LIBRARIES=1

into .bashrc, but as I got aware just now, these settings have no effect since I call port as sudo port.

Could you please advice me how to set build.env?

comment:15 in reply to:  14 ; Changed 5 years ago by larryv (Lawrence Velázquez)

Run this and add the new variables at the appropriate place (somewhere between lines 129 and 145 in the current portfile):

sudo -e $(port file llvm-gcc42)

comment:16 in reply to:  15 Changed 5 years ago by udbraumann

Thanks, I have added the two variables in the Portfile

...
145     OTOOL64=${prefix}/bin/otool \
146     DYLD_PRINT_ENV=1 \
147     DYLD_PRINT_LIBRARIES=1
...

Please see main_DYLD.log.gz, my impression is that a different problem occurs now, but have a look by yourself. Thanks!

Changed 5 years ago by udbraumann

Attachment: main_DYLD.log.gz added

comment:17 Changed 9 months ago by kencu (Ken)

Cc: kencu added
Note: See TracTickets for help on using tickets.