[LLVMdev] How do I disable --version-script when cross compiling clang/LLVM on a Mac?

Richard Pennington rich at pennware.com
Sun Dec 22 09:45:22 PST 2013


On 12/21/2013 10:37 PM, Alp Toker wrote:
> You'll have to test this yourself, but assuming you're on the Makefile 
> build system and already set up correctly for a cross-compile, this 
> might be the cause:
>
> The variable HAVE_LINK_VERSION_SCRIPT determines how the linker is 
> called, and is detected at configure time by autoconf/m4/link_options.m4.
>
> Some of the Makefile.rules files have an additional ifeq 
> ($(HOST_OS),Darwin) check surrounding use of that flag.
>
> That check may be confusing the host and target platforms when 
> building up linker flags, and if so you've found a corner-case bug in 
> the build system. I'd suggest hard-coding values in a few of those 
> places to see if you can get the right flags passed depending on 
> whether a host or target binary is getting built.
>
> Alp.
>
I found a band aid for my problem in Makefile.rules:
ifeq ($(HOST_OS), $(filter $(HOST_OS), DragonFly Linux NetBSD FreeBSD 
GNU/kFreeBSD GNU))
ifneq ($(shell uname -s),Darwin)
ifneq ($(ARCH), Mips)
   LD.Flags += -Wl,--version-script=$(LLVM_SRC_ROOT)/autoconf/ExportMap.map
endif
endif
endif

It turns out that HOST_OS is set to Linux for cross compiling in my 
case. I added the Darwin conditional. Did I configure something incorrectly?

-Rich




More information about the llvm-dev mailing list