[LLVMdev] Darwin option processing

Chris Lattner clattner at apple.com
Fri May 8 11:49:33 PDT 2009


On May 7, 2009, at 6:24 PM, Mike Stump wrote:
> I'm toying with building with -mdynamic-no-pic, but for this to work,
> the shared library bits in llvm can't be built with that flag.

Hi Mike,

If you're doing this for Clang's benefit, I think the best thing to do  
is to compile LLVM PIC (the default) and then build the clang front- 
end pieces with -mdynamic-no-pic.  Does this work for you?

-Chris

>
>
> I've found that:
>
> Index: Makefile.rules
> ===================================================================
> --- Makefile.rules	(revision 71041)
> +++ Makefile.rules	(working copy)
> @@ -472,6 +476,9 @@
>  ifneq ($(DARWIN_MAJVERS),4)
>    LD.Flags += $(RPATH) -Wl,$(LibDir)
>  endif
> +  ifeq ($(OS),Darwin)
> +    EXTRA_OPTIONS := $(filter-out -mdynamic-no-pic,$(EXTRA_OPTIONS))
> +  endif
>  endif
>
>  ifdef TOOL_VERBOSE
>
>
> can be used to strip the option out in the places it won't work.  This
> mirrors the style used in other parts of the file.  If the experiment
> goes well, I'd like to check this in, if no objections.  If someone
> wants to approve it (pending testing), let me know...
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list