"dyld: Library not loaded" llvm-gcc error

After installing llvm and llvm-gcc 4.2 on Mac OS X I tried
running
"An Example Using the LLVM Tool Chain" at
http://llvm.org/docs/GettingStarted.html .

In step 4, the command

./hello

fails with the message:

dyld: Library not loaded:
/Users/tonic/2.3/llvm-gcc/install/lib/libgcc_s.1.dylib
  Referenced from: /Users/Username/Path/./hello
  Reason: image not found
Trace/BPT trap

However, all of the other steps in the example work
correctly, apart from compiling directly to native code
with llvm-gcc.

Is there a way to fix this error?

After installing llvm and llvm-gcc 4.2 on Mac OS X I tried
running
"An Example Using the LLVM Tool Chain" at
http://llvm.org/docs/GettingStarted.html .

In step 4, the command

./hello

fails with the message:

dyld: Library not loaded:
/Users/tonic/2.3/llvm-gcc/install/lib/libgcc_s.1.dylib
Referenced from: /Users/Username/Path/./hello
Reason: image not found
Trace/BPT trap

However, all of the other steps in the example work
correctly, apart from compiling directly to native code
with llvm-gcc.

Hi,

This looks like a mistake made in packaging the release, which apparently was configured with --prefix=$HOME/2.3/llvm-gcc/install. (It's not your fault.)

Is there a way to fix this error?

You could build and install llvm-gcc 2.3 from the source distribution, or the latest llvm and llvm-gcc from Subversion.

— Gordon