Skip to Content.
Sympa Menu

svadev - [svadev] Antwort: Re: clang: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation)

svadev AT lists.siebelschool.illinois.edu

Subject: Svadev mailing list

List archive

[svadev] Antwort: Re: clang: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation)


Chronological Thread 
  • From: Stefan.Scheruebl AT continental-corporation.com
  • To: jonas.wagner AT epfl.ch
  • Cc: svadev AT cs.uiuc.edu
  • Subject: [svadev] Antwort: Re: clang: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation)
  • Date: Wed, 19 Nov 2014 06:42:03 +0100
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/svadev/>
  • List-id: <svadev.cs.uiuc.edu>

Hi Jonas,

thanks for your response! Main thing first - I'm now able to compile without errors :-)

But I think I've still knowlege leaks regarding the Clang/LLVM design. So I try to explain what has happend in my fail case out of my view - correct me if I'm wrong...

1) Clang is the C-Frontend and works properly with the -fmemsaftey option (in my clang compilation)
2) The Clang compilation uses the native linker - in my case part of gcc - to link the native executeable which does not supply the -fmemsafety option support
3) LLVM supplies no native linker - till now - only a IR code linker
4) So the linker works correct if the -fmemsafety option is not used but in my case I forgot to add the safecode libraries to the linker call

Question:
1: How can I configure the clang compilation in a way that the linker is called without this -fmemsafety option automatically?
2: How can I configure the clang compilation in a way that the missing safecode libraries are automatically assigned to the linker command line when I call clang?

This command worked for me - how can I compile clang to use all the parameter as default?

$ CFLAGS="-g -fmemsafety -integrated-as" clang testcode.c -I/home/uid04950/WORK/LLVM_INSTALL/include -L/home/uid04950/WORK/LLVM_INSTALL/lib -lsc_dbg_rt -lsc_bb_rt -lgcc -lpoolalloc_bitmap -lstdc++ -lgdtoa -lgdtoa -lgcc_s -lc

Stefan




Von:        Jonas Wagner <jonas.wagner AT epfl.ch>
An:        Stefan.Scheruebl AT continental-corporation.com,
Kopie:        svadev AT cs.uiuc.edu
Datum:        18.11.2014 14:47
Betreff:        Re: [svadev] clang: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation)




Hi,

sorry for the late reply!

In the second case, the linker command likely fails because you didn't add the -fmemsafety option to the linker command line.

In the first case, it seems to fail because gcc does not recognize the -fmemsafety flag. I don't understand why clang would call GCC to link the program instead of doing it itself. Maybe this is the default behavior under cygwin? Have you checked whether the issue arises also when you run this under Linux?

Best,
Jonas




Archive powered by MHonArc 2.6.16.

Top of Page