[CMake] Specify 32-bit compilation to Clang

Robert Dailey rcdailey.lists at gmail.com
Tue Jan 20 10:48:56 EST 2015


On Mon, Jan 19, 2015 at 2:12 PM, Nils Gladitz <nilsgladitz at gmail.com> wrote:
> On 19.01.2015 21:08, Robert Dailey wrote:
>>
>> I have done this and it fails while linking the test program during
>> configuration:
>>
>> /usr/bin/ld: cannot find crtbegin.o: no such file or directory
>> /usr/bin/ld: cannot find -lgcc
>> /usr/bin/ld: cannot find -lgcc_s
>>
>> Any ideas?
>>
>
> Try installing the g++-multilib package.

Installed this as you instructed, deleted CMakeCache.txt and re-ran
generation. Got the errors below:

-- The C compiler identification is Clang 3.5.0
-- The CXX compiler identification is Clang 3.5.0
-- Check for working C compiler using: Ninja
-- Check for working C compiler using: Ninja -- broken
CMake Error at /usr/share/cmake-3.1/Modules/CMakeTestCCompiler.cmake:61
(message                          ):
  The C compiler "/usr/bin/clang" is not able to compile a simple test
  program.

  It fails with the following output:

   Change Dir: /home/robert/frontend_build/CMakeFiles/CMakeTmp



  Run Build Command:"/home/robert/ninja/ninja" "cmTryCompileExec2104404287"

  [1/2] Building C object
  CMakeFiles/cmTryCompileExec2104404287.dir/testCCompiler.c.o

  [2/2] Linking C executable cmTryCompileExec2104404287

  FAILED: : && /usr/bin/clang -m32
  CMakeFiles/cmTryCompileExec2104404287.dir/testCCompiler.c.o -o
  cmTryCompileExec2104404287 -rdynamic && :

  /usr/bin/ld: skipping incompatible
  /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/libgcc.a when searching for -lgcc

  /usr/bin/ld: cannot find -lgcc

  /usr/bin/ld: skipping incompatible
  /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/libgcc_s.so when searching for
  -lgcc_s

  /usr/bin/ld: cannot find -lgcc_s

  clang: error: linker command failed with exit code 1 (use -v to see
  invocation)

  ninja: build stopped: subcommand failed.


More information about the CMake mailing list