[Bug middle-end/54806] [4.7 Regression] Undefined symbols: "___emutls_v.*", ... on x86_64-apple-darwin12

howarth at nitro dot med.uc.edu gcc-bugzilla@gcc.gnu.org
Sat Oct 6 00:47:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54806

--- Comment #10 from Jack Howarth <howarth at nitro dot med.uc.edu> 2012-10-06 00:47:13 UTC ---
I can confirm on 10.7.5 that the provided test case fails with the gcc47-4.7.2
package from current MacPorts but compiles fine with my gcc47-4.7.2 packaging
from fink. 

MacPorts's g++-fsf-4.7 fails the link as...

% /opt/local/bin/g++-mp-4.7 -std=c++11 testcase.cpp
Undefined symbols for architecture x86_64:
  "___emutls_v._ZSt11__once_call", referenced from:
      void std::call_once<void
(std::__future_base::_State_base::*)(std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()>&, bool&),
std::__future_base::_State_base* const,
std::reference_wrapper<std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()> >, std::reference_wrapper<bool>
>(std::once_flag&, void
(std::__future_base::_State_base::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()>&, bool&),
std::__future_base::_State_base* const&&,
std::reference_wrapper<std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()> >&&,
std::reference_wrapper<bool>&&) in ccj0NKsr.o
  "___emutls_v._ZSt15__once_callable", referenced from:
      void std::call_once<void
(std::__future_base::_State_base::*)(std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()>&, bool&),
std::__future_base::_State_base* const,
std::reference_wrapper<std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()> >, std::reference_wrapper<bool>
>(std::once_flag&, void
(std::__future_base::_State_base::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()>&, bool&),
std::__future_base::_State_base* const&&,
std::reference_wrapper<std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()> >&&,
std::reference_wrapper<bool>&&) in ccj0NKsr.o
      void std::__once_call_impl<std::_Bind_simple<std::_Mem_fn<void
(std::__future_base::_State_base::*)(std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()>&, bool&)>
(std::__future_base::_State_base*,
std::reference_wrapper<std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()> >,
std::reference_wrapper<bool>)> >() in ccj0NKsr.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
[MacBookPro:~/Downloads] howarth% /opt/local/bin/g++-mp-4.7 -std=c++11
testcase.cpp -v
Using built-in specs.
COLLECT_GCC=/opt/local/bin/g++-mp-4.7
COLLECT_LTO_WRAPPER=/opt/local/libexec/gcc/x86_64-apple-darwin11/4.7.2/lto-wrapper
Target: x86_64-apple-darwin11
Configured with: ../gcc-4.7.2/configure --prefix=/opt/local
--build=x86_64-apple-darwin11
--enable-languages=c,c++,objc,obj-c++,lto,fortran,java
--libdir=/opt/local/lib/gcc47 --includedir=/opt/local/include/gcc47
--infodir=/opt/local/share/info --mandir=/opt/local/share/man
--datarootdir=/opt/local/share/gcc-4.7 --with-libiconv-prefix=/opt/local
--with-local-prefix=/opt/local --with-system-zlib --disable-nls
--program-suffix=-mp-4.7 --with-gxx-include-dir=/opt/local/include/gcc47/c++/
--with-gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local
--with-ppl=/opt/local --with-cloog=/opt/local --enable-cloog-backend=isl
--disable-cloog-version-check --enable-stage1-checking --disable-multilib
--enable-lto --enable-libstdcxx-time --with-as=/opt/local/bin/as
--with-ld=/opt/local/bin/ld --with-ar=/opt/local/bin/ar
--with-bugurl=https://trac.macports.org/newticket --disable-ppl-version-check
--with-pkgversion='MacPorts gcc47 4.7.2_2'
Thread model: posix
gcc version 4.7.2 (MacPorts gcc47 4.7.2_2) 
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.7.4' '-std=c++11' '-v'
'-shared-libgcc' '-mtune=core2'
 /opt/local/libexec/gcc/x86_64-apple-darwin11/4.7.2/cc1plus -quiet -v
-D__DYNAMIC__ testcase.cpp -fPIC -quiet -dumpbase testcase.cpp
-mmacosx-version-min=10.7.4 -mtune=core2 -auxbase testcase -std=c++11 -version
-o /var/folders/1l/n78sywl52lz6kkys6nv7mnph0000gp/T//cc6rD9Bc.s
GNU C++ (MacPorts gcc47 4.7.2_2) version 4.7.2 (x86_64-apple-darwin11)
    compiled by GNU C version 4.7.2, GMP version 5.0.5, MPFR version 3.1.1-p2,
MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory
"/opt/local/lib/gcc47/gcc/x86_64-apple-darwin11/4.7.2/../../../../../x86_64-apple-darwin11/include"
#include "..." search starts here:
#include <...> search starts here:
 /opt/local/include/gcc47/c++/
 /opt/local/include/gcc47/c++//x86_64-apple-darwin11
 /opt/local/include/gcc47/c++//backward
 /opt/local/lib/gcc47/gcc/x86_64-apple-darwin11/4.7.2/include
 /opt/local/include
 /opt/local/lib/gcc47/gcc/x86_64-apple-darwin11/4.7.2/include-fixed
 /usr/include
 /System/Library/Frameworks
 /Library/Frameworks
End of search list.
GNU C++ (MacPorts gcc47 4.7.2_2) version 4.7.2 (x86_64-apple-darwin11)
    compiled by GNU C version 4.7.2, GMP version 5.0.5, MPFR version 3.1.1-p2,
MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 3037b7daaf0a72ee14f224f5c0e272f9
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.7.4' '-std=c++11' '-v'
'-shared-libgcc' '-mtune=core2'
 /opt/local/bin/as -v -arch x86_64 -force_cpusubtype_ALL -o
/var/folders/1l/n78sywl52lz6kkys6nv7mnph0000gp/T//ccAQju5a.o
/var/folders/1l/n78sywl52lz6kkys6nv7mnph0000gp/T//cc6rD9Bc.s
Apple Inc version cctools-829, GNU assembler version 1.38
COMPILER_PATH=/opt/local/libexec/gcc/x86_64-apple-darwin11/4.7.2/:/opt/local/libexec/gcc/x86_64-apple-darwin11/4.7.2/:/opt/local/libexec/gcc/x86_64-apple-darwin11/:/opt/local/lib/gcc47/gcc/x86_64-apple-darwin11/4.7.2/:/opt/local/lib/gcc47/gcc/x86_64-apple-darwin11/
LIBRARY_PATH=/opt/local/lib/gcc47/gcc/x86_64-apple-darwin11/4.7.2/:/opt/local/lib/gcc47/gcc/x86_64-apple-darwin11/4.7.2/../../../:/usr/lib/
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.7.4' '-std=c++11' '-v'
'-shared-libgcc' '-mtune=core2'
 /opt/local/libexec/gcc/x86_64-apple-darwin11/4.7.2/collect2 -dynamic -arch
x86_64 -macosx_version_min 10.7.4 -weak_reference_mismatches non-weak -o a.out
-lcrt1.10.6.o -L/opt/local/lib/gcc47/gcc/x86_64-apple-darwin11/4.7.2
-L/opt/local/lib/gcc47/gcc/x86_64-apple-darwin11/4.7.2/../../..
/var/folders/1l/n78sywl52lz6kkys6nv7mnph0000gp/T//ccAQju5a.o -lstdc++
-no_compact_unwind -lSystem -lgcc_ext.10.5 -lgcc -lSystem -v
collect2 version 4.7.2
/opt/local/bin/ld -dynamic -arch x86_64 -macosx_version_min 10.7.4
-weak_reference_mismatches non-weak -o a.out -lcrt1.10.6.o
-L/opt/local/lib/gcc47/gcc/x86_64-apple-darwin11/4.7.2
-L/opt/local/lib/gcc47/gcc/x86_64-apple-darwin11/4.7.2/../../..
/var/folders/1l/n78sywl52lz6kkys6nv7mnph0000gp/T//ccAQju5a.o -lstdc++
-no_compact_unwind -lSystem -lgcc_ext.10.5 -lgcc -lSystem -v
@(#)PROGRAM:ld  PROJECT:ld64-133.3
configured to support archs: armv6 armv7 i386 x86_64
Library search paths:
    /opt/local/lib/gcc47/gcc/x86_64-apple-darwin11/4.7.2
    /opt/local/lib/gcc47
    /usr/lib
    /usr/local/lib
Framework search paths:
    /Library/Frameworks/
    /System/Library/Frameworks/
Undefined symbols for architecture x86_64:
  "___emutls_v._ZSt11__once_call", referenced from:
      void std::call_once<void
(std::__future_base::_State_base::*)(std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()>&, bool&),
std::__future_base::_State_base* const,
std::reference_wrapper<std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()> >, std::reference_wrapper<bool>
>(std::once_flag&, void
(std::__future_base::_State_base::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()>&, bool&),
std::__future_base::_State_base* const&&,
std::reference_wrapper<std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()> >&&,
std::reference_wrapper<bool>&&) in ccAQju5a.o
  "___emutls_v._ZSt15__once_callable", referenced from:
      void std::call_once<void
(std::__future_base::_State_base::*)(std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()>&, bool&),
std::__future_base::_State_base* const,
std::reference_wrapper<std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()> >, std::reference_wrapper<bool>
>(std::once_flag&, void
(std::__future_base::_State_base::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()>&, bool&),
std::__future_base::_State_base* const&&,
std::reference_wrapper<std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()> >&&,
std::reference_wrapper<bool>&&) in ccAQju5a.o
      void std::__once_call_impl<std::_Bind_simple<std::_Mem_fn<void
(std::__future_base::_State_base::*)(std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()>&, bool&)>
(std::__future_base::_State_base*,
std::reference_wrapper<std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()> >,
std::reference_wrapper<bool>)> >() in ccAQju5a.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status

whereas g++-fsf-4.7 on fink links properly as...

% g++-fsf-4.7 -std=c++11 testcase.cpp -v
Using built-in specs.
COLLECT_GCC=g++-fsf-4.7
COLLECT_LTO_WRAPPER=/sw/lib/gcc4.7/libexec/gcc/x86_64-apple-darwin11.4.2/4.7.2/lto-wrapper
Target: x86_64-apple-darwin11.4.2
Configured with: ../gcc-4.7.2/configure --prefix=/sw --prefix=/sw/lib/gcc4.7
--mandir=/sw/share/man --infodir=/sw/lib/gcc4.7/info
--enable-languages=c,c++,fortran,lto,objc,obj-c++,java --with-gmp=/sw
--with-libiconv-prefix=/sw --with-ppl=/sw --with-cloog=/sw --with-mpc=/sw
--with-system-zlib --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib
--program-suffix=-fsf-4.7 --enable-cloog-backend=isl
Thread model: posix
gcc version 4.7.2 (GCC) 
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.7.4' '-std=c++11' '-v'
'-shared-libgcc' '-mtune=core2'
 /sw/lib/gcc4.7/libexec/gcc/x86_64-apple-darwin11.4.2/4.7.2/cc1plus -quiet -v
-D__DYNAMIC__ testcase.cpp -fPIC -quiet -dumpbase testcase.cpp
-mmacosx-version-min=10.7.4 -mtune=core2 -auxbase testcase -std=c++11 -version
-o /var/folders/1l/n78sywl52lz6kkys6nv7mnph0000gp/T//ccqbRW1j.s
GNU C++ (GCC) version 4.7.2 (x86_64-apple-darwin11.4.2)
    compiled by GNU C version 4.7.2, GMP version 5.0.5, MPFR version 3.1.1, MPC
version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory
"/sw/lib/gcc4.7/lib/gcc/x86_64-apple-darwin11.4.2/4.7.2/../../../../x86_64-apple-darwin11.4.2/include"
#include "..." search starts here:
#include <...> search starts here:

/sw/lib/gcc4.7/lib/gcc/x86_64-apple-darwin11.4.2/4.7.2/../../../../include/c++/4.7.2

/sw/lib/gcc4.7/lib/gcc/x86_64-apple-darwin11.4.2/4.7.2/../../../../include/c++/4.7.2/x86_64-apple-darwin11.4.2

/sw/lib/gcc4.7/lib/gcc/x86_64-apple-darwin11.4.2/4.7.2/../../../../include/c++/4.7.2/backward
 /sw/lib/gcc4.7/lib/gcc/x86_64-apple-darwin11.4.2/4.7.2/include
 /sw/lib/gcc4.7/include
 /sw/lib/gcc4.7/lib/gcc/x86_64-apple-darwin11.4.2/4.7.2/include-fixed
 /usr/include
 /System/Library/Frameworks
 /Library/Frameworks
End of search list.
GNU C++ (GCC) version 4.7.2 (x86_64-apple-darwin11.4.2)
    compiled by GNU C version 4.7.2, GMP version 5.0.5, MPFR version 3.1.1, MPC
version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: c8f330d0099bd2c4219a56cc67fa3751
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.7.4' '-std=c++11' '-v'
'-shared-libgcc' '-mtune=core2'
 as -arch x86_64 -force_cpusubtype_ALL -o
/var/folders/1l/n78sywl52lz6kkys6nv7mnph0000gp/T//ccIAuiv1.o
/var/folders/1l/n78sywl52lz6kkys6nv7mnph0000gp/T//ccqbRW1j.s
COMPILER_PATH=/sw/lib/gcc4.7/libexec/gcc/x86_64-apple-darwin11.4.2/4.7.2/:/sw/lib/gcc4.7/libexec/gcc/x86_64-apple-darwin11.4.2/4.7.2/:/sw/lib/gcc4.7/libexec/gcc/x86_64-apple-darwin11.4.2/:/sw/lib/gcc4.7/lib/gcc/x86_64-apple-darwin11.4.2/4.7.2/:/sw/lib/gcc4.7/lib/gcc/x86_64-apple-darwin11.4.2/
LIBRARY_PATH=/sw/lib/gcc4.7/lib/gcc/x86_64-apple-darwin11.4.2/4.7.2/:/sw/lib/gcc4.7/lib/gcc/x86_64-apple-darwin11.4.2/4.7.2/../../../:/usr/lib/
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.7.4' '-std=c++11' '-v'
'-shared-libgcc' '-mtune=core2'
 /sw/lib/gcc4.7/libexec/gcc/x86_64-apple-darwin11.4.2/4.7.2/collect2 -dynamic
-arch x86_64 -macosx_version_min 10.7.4 -weak_reference_mismatches non-weak -o
a.out -lcrt1.10.6.o -L/sw/lib/gcc4.7/lib/gcc/x86_64-apple-darwin11.4.2/4.7.2
-L/sw/lib/gcc4.7/lib/gcc/x86_64-apple-darwin11.4.2/4.7.2/../../..
/var/folders/1l/n78sywl52lz6kkys6nv7mnph0000gp/T//ccIAuiv1.o -lstdc++
-no_compact_unwind -lSystem -lgcc_ext.10.5 -lgcc -lSystem -v
collect2 version 4.7.2
/usr/bin/ld -dynamic -arch x86_64 -macosx_version_min 10.7.4
-weak_reference_mismatches non-weak -o a.out -lcrt1.10.6.o
-L/sw/lib/gcc4.7/lib/gcc/x86_64-apple-darwin11.4.2/4.7.2
-L/sw/lib/gcc4.7/lib/gcc/x86_64-apple-darwin11.4.2/4.7.2/../../..
/var/folders/1l/n78sywl52lz6kkys6nv7mnph0000gp/T//ccIAuiv1.o -lstdc++
-no_compact_unwind -lSystem -lgcc_ext.10.5 -lgcc -lSystem -v
@(#)PROGRAM:ld  PROJECT:ld64-134.9
configured to support archs: armv6 armv7 armv7s i386 x86_64
Library search paths:
    /sw/lib/gcc4.7/lib/gcc/x86_64-apple-darwin11.4.2/4.7.2
    /sw/lib/gcc4.7/lib
    /usr/lib
    /usr/local/lib
Framework search paths:
    /Library/Frameworks/
    /System/Library/Frameworks/
%

and the resulting a.out runs fine.



More information about the Gcc-bugs mailing list