[MacPorts] #27237: gcc46: checking for -exported_symbols_list linker flag... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES.
MacPorts
noreply at macports.org
Sun Oct 30 07:25:42 PDT 2011
#27237: gcc46: checking for -exported_symbols_list linker flag... configure: error:
Link tests are not allowed after GCC_NO_EXECUTABLES.
-------------------------------------+--------------------------------------
Reporter: ryandesign@… | Owner: mww@…
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 1.9.2
Keywords: | Port: gcc46
-------------------------------------+--------------------------------------
Comment(by ionic@…):
Nope, won't work, as _GLIBCXX_FULLY_DYNAMIC_STRING is set by --enable-
fully-dynamic-string already.
Ok, some more information here.
For once, I found out through debugging that !__p is null/0x0, although
this shouldn't ever happen (at least the code says so in
new_allocator.h:98:
{{{
// __p is not permitted to be a null pointer.
void
deallocate(pointer __p, size_type)
{ ::operator delete(__p); }
}}}
Then, I tried to manually reproduce the problem with conftest3.c:
{{{
int foo(void){return 1;}
}}}
and this command line:
{{{
/opt/local/var/macports/build/_opt_local_var_macports_sources_macports.rsync.ionic.de_release_ports_lang_gcc46/gcc46/work/build/./gcc/xgcc
-B/opt/local/var/macports/build/_opt_local_var_macports_sources_macports.rsync.ionic.de_release_ports_lang_gcc46/gcc46/work/build/./gcc/
-B/opt/local/x86_64-apple-darwin10/bin/ -B/opt/local/x86_64-apple-
darwin10/lib/ -isystem /opt/local/x86_64-apple-darwin10/include -isystem
/opt/local/x86_64-apple-darwin10/sys-include -g -pipe -O2 -o
libconftest.dylib -dynamiclib -Wl,-single_module conftest3.c
}}}
This, however, worked fine and didn't crash. Having a look at otool -L
/usr/bin/ld (which is crashing...) shows that...
{{{
/usr/bin/ld.orig:
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current
version 7.9.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
version 125.2.0)
@executable_path/../lib/libLTO.dylib (compatibility version 1.0.0,
current version 3135.0.0)
}}}
The ld binary actually dynamically links to the libstdc++. Now, as we
build GCC 4.6 and for that matter also a newer libstdc++, the build system
probably tried to use that new lib instead of the system library. We can
"emulate" this by using the following command line (when PWD ==
/opt/local/var/macports/build/_opt_local_var_macports_sources_macports.rsync.ionic.de_release_ports_lang_gcc46/gcc46/work/build/x86_64
-apple-darwin10/libssp):
{{{
DYLD_LIBRARY_PATH="../libstdc++-v3/src/.libs/"
/opt/local/var/macports/build/_opt_local_var_macports_sources_macports.rsync.ionic.de_release_ports_lang_gcc46/gcc46/work/build/./gcc/xgcc
-B/opt/local/var/macports/build/_opt_local_var_macports_sources_macports.rsync.ionic.de_release_ports_lang_gcc46/gcc46/work/build/./gcc/
-B/opt/local/x86_64-apple-darwin10/bin/ -B/opt/local/x86_64-apple-
darwin10/lib/ -isystem /opt/local/x86_64-apple-darwin10/include -isystem
/opt/local/x86_64-apple-darwin10/sys-include -g -pipe -O2 -o
libconftest.dylib -dynamiclib -Wl,-single_module conftest3.c
}}}
Gotcha, there we got the crash again. So it's definitely connected to the
newly build libstdc++.
Now, I replaced /usr/bin/ld with a script that calls /usr/bin/ld.orig (the
original binary) and sends a SIGSTOP immediatly, which also enabled me to
attach gdb to the process. Have a look at this:
{{{
(gdb) break malloc_error_break
Breakpoint 2 at 0x3126e978c69499
(gdb) cont
Continuing.
Program received signal SIGSTOP, Stopped (signal).
0x00007fff5fc04f5f in
__dyld__ZN4dyldL10loadPhase5EPKcRKNS_11LoadContextEPSt6vectorIS1_SaIS1_EE
()
(gdb) cont
Continuing.
Program received signal SIGSTOP, Stopped (signal).
0x00007fff5fc219d6 in __dyld_stat64 ()
(gdb) cont
Continuing.
Reading symbols for shared libraries .+. done
Breakpoint 3 at 0x100219c34: file new_allocator.h, line 98.
Breakpoint 4 at 0x100219c64: file new_allocator.h, line 98.
Breakpoint 5 at 0x10021b084: file new_allocator.h, line 98.
Breakpoint 6 at 0x10021bab0: file new_allocator.h, line 98.
Breakpoint 7 at 0x10021bac0: file new_allocator.h, line 98.
Breakpoint 8 at 0x10021bc24: file new_allocator.h, line 98.
Breakpoint 9 at 0x10021c2f4: file new_allocator.h, line 98.
Breakpoint 10 at 0x10021cc3a: file new_allocator.h, line 98.
warning: Multiple breakpoints were set.
Use the "delete" command to delete unwanted breakpoints.
Pending breakpoint 1 - "new_allocator.h:98" resolved
Program received signal SIGSTOP, Stopped (signal).
0x00007fff5fc0a2de in
__dyld__ZL18gdb_image_notifier15dyld_image_modejPK15dyld_image_info ()
(gdb) cont
Continuing.
Program received signal SIGSTOP, Stopped (signal).
0x00007fff5fc1502f in
__dyld__ZN26ImageLoaderMachOCompressed6rebaseERKN11ImageLoader11LinkContextE
()
(gdb) cont
Continuing.
Reading symbols for shared libraries . done
Breakpoint 9, std::string::assign (this=0x101777fa8, __str=<value
temporarily unavailable, due to optimizations>) at new_allocator.h:98
98 { ::operator delete(__p); }
(gdb) print __p
Cannot access memory at address 0x0
}}}
Something is really, really broken and upstream should fix that.
However, I'll rebuild gcc45 and try to use that libstdc++ as that's the
last known good version to me. We'll see.
--
Ticket URL: <https://trac.macports.org/ticket/27237#comment:14>
MacPorts <http://www.macports.org/>
Ports system for Mac OS
More information about the macports-tickets
mailing list