I am trying to compile a program using a self-compiled GCC-4.7.1 on Mac OS 10.8.2. The program uses openMP and the compilation succeeds; however, when I try to run the program, the dynamic linker complains with

dyld: lazy symbol binding failed: Symbol not found: ___emutls_get_address
  Referenced from: /usr/local/gcc-4.7.1/lib/libgomp.1.dylib
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: ___emutls_get_address
  Referenced from: /usr/local/gcc-4.7.1/lib/libgomp.1.dylib
  Expected in: /usr/lib/libSystem.B.dylib

This issue is constantly present in any program compiled with -fopenmp, including the MWE

#include <stdio.h>

int main() {
  #pragma omp parallel
  printf("Hallo!\n");
  return 0;
}

Note that the solution suggested in What is the "___emutls_get_address" symbol?, namely adding -lgcc_eh in the linking phase, does not work (I still get the same dyld error message).

Edit
Report