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

Anton Korobeynikov anton at korobeynikov.info
Sun Dec 22 10:19:23 PST 2013


It seems it should be build OS, not host OS here...

On Sun, Dec 22, 2013 at 9:45 PM, Richard Pennington <rich at pennware.com> wrote:
> 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
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev



-- 
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University



More information about the llvm-dev mailing list