[llvm-commits] [llvm] r101399 - in /llvm/trunk: Makefile.rules tools/edis/EnhancedDisassembly.exports tools/edis/Makefile tools/lto/Makefile tools/lto/lto.exports

Nick Lewycky nlewycky at google.com
Fri Apr 16 10:42:19 PDT 2010


On 15 April 2010 13:54, Dan Gohman <gohman at apple.com> wrote:

> Author: djg
> Date: Thu Apr 15 15:54:25 2010
> New Revision: 101399
>
> URL: http://llvm.org/viewvc/llvm-project?rev=101399&view=rev
> Log:
> Generalize the EXPORTED_SYMBOL_FILE concept in the Makefiles to work with
> native linking export files, including running sed to prepend underscores
> on darwin, and make use of it in libLTO and libEnhancedDisassembly.
>
> Remove the leading underscores from library export files so that they
> work with the new EXPORTED_SYMBOL_FILE support.
>
> Modified:
>    llvm/trunk/Makefile.rules
>    llvm/trunk/tools/edis/EnhancedDisassembly.exports
>    llvm/trunk/tools/edis/Makefile
>    llvm/trunk/tools/lto/Makefile
>    llvm/trunk/tools/lto/lto.exports
>
> Modified: llvm/trunk/Makefile.rules
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.rules?rev=101399&r1=101398&r2=101399&view=diff
>
> ==============================================================================
> --- llvm/trunk/Makefile.rules (original)
> +++ llvm/trunk/Makefile.rules Thu Apr 15 15:54:25 2010
> @@ -970,6 +970,37 @@
>  endif
>  endif
>
> +# Set up the library exports file.
> +ifdef EXPORTED_SYMBOL_FILE
> +
> +# First, set up the native export file, which may differ from the source
> +# export file.
> +
> +ifeq ($(HOST_OS),Darwin)
> +# Darwin convention prefixes symbols with underscores.
> +NativeExportsFile := $(ObjDir)/$(EXPORTED_SYMBOL_FILE).sed
> +$(NativeExportsFile): $(EXPORTED_SYMBOL_FILE)
> +       $(Verb) sed -e 's/[[:<:]]/_/' < $< > $@
> +clean-local::
> +       -$(Verb) $(RM) -f $(NativeExportsFile)
> +else
> +NativeExportsFile := $(EXPORTED_SYMBOL_FILE)
> +endif
> +
> +# Now add the linker command-line options to use the native export file.
> +
> +ifeq ($(HOST_OS),Darwin)
> +LLVMLibsOptions += -Wl,-exported_symbols_list -Wl,$(NativeExportsFile)
> +endif
> +
> +# This isn't really Linux-specific; it works at least on gold and bfd ld,
> but
> +# there's no convenient way to detect it.
> +ifeq ($(HOST_OS),Linux)
> +LLVMLibsOptions += -Wl,-retain-symbols-file -Wl,$(NativeExportsFile)
>

This broke the tools/edis build on my system because the snapshot version of
gold I have happens to not support the -retain-symbols-file flag, and
instead parsed it as '-r' which is incompatible with '-shared'.

I don't know whether this is unique to my snapshot (and I'm going to update
it now -- why not?) but if there were a gold release that didn't support
this flag, it might be necessary to move it to a configure test.

Nick

+endif
> +
> +endif
> +
>
>  ###############################################################################
>  # Library Build Rules: Four ways to build a library
>
>  ###############################################################################
> @@ -1060,6 +1091,10 @@
>
>  all-local:: $(LibName.SO)
>
> +ifdef EXPORTED_SYMBOL_FILE
> +$(LibName.SO): $(NativeExportsFile)
> +endif
> +
>  ifdef LINK_LIBS_IN_SHARED
>  ifdef LOADABLE_MODULE
>  SharedLibKindMessage := "Loadable Module"
>
> Modified: llvm/trunk/tools/edis/EnhancedDisassembly.exports
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/edis/EnhancedDisassembly.exports?rev=101399&r1=101398&r2=101399&view=diff
>
> ==============================================================================
> --- llvm/trunk/tools/edis/EnhancedDisassembly.exports (original)
> +++ llvm/trunk/tools/edis/EnhancedDisassembly.exports Thu Apr 15 15:54:25
> 2010
> @@ -1,36 +1,36 @@
> -_EDGetDisassembler
> -_EDGetRegisterName
> -_EDRegisterIsStackPointer
> -_EDRegisterIsProgramCounter
> -_EDCreateInsts
> -_EDReleaseInst
> -_EDInstByteSize
> -_EDGetInstString
> -_EDInstIsBranch
> -_EDInstIsMove
> -_EDBranchTargetID
> -_EDMoveSourceID
> -_EDMoveTargetID
> -_EDNumTokens
> -_EDGetToken
> -_EDGetTokenString
> -_EDOperandIndexForToken
> -_EDTokenIsWhitespace
> -_EDTokenIsPunctuation
> -_EDTokenIsOpcode
> -_EDTokenIsLiteral
> -_EDTokenIsRegister
> -_EDTokenIsNegativeLiteral
> -_EDLiteralTokenAbsoluteValue
> -_EDRegisterTokenValue
> -_EDNumOperands
> -_EDGetOperand
> -_EDOperandIsRegister
> -_EDOperandIsImmediate
> -_EDOperandIsMemory
> -_EDRegisterOperandValue
> -_EDImmediateOperandValue
> -_EDEvaluateOperand
> -_EDBlockCreateInsts
> -_EDBlockEvaluateOperand
> -_EDBlockVisitTokens
> +EDGetDisassembler
> +EDGetRegisterName
> +EDRegisterIsStackPointer
> +EDRegisterIsProgramCounter
> +EDCreateInsts
> +EDReleaseInst
> +EDInstByteSize
> +EDGetInstString
> +EDInstIsBranch
> +EDInstIsMove
> +EDBranchTargetID
> +EDMoveSourceID
> +EDMoveTargetID
> +EDNumTokens
> +EDGetToken
> +EDGetTokenString
> +EDOperandIndexForToken
> +EDTokenIsWhitespace
> +EDTokenIsPunctuation
> +EDTokenIsOpcode
> +EDTokenIsLiteral
> +EDTokenIsRegister
> +EDTokenIsNegativeLiteral
> +EDLiteralTokenAbsoluteValue
> +EDRegisterTokenValue
> +EDNumOperands
> +EDGetOperand
> +EDOperandIsRegister
> +EDOperandIsImmediate
> +EDOperandIsMemory
> +EDRegisterOperandValue
> +EDImmediateOperandValue
> +EDEvaluateOperand
> +EDBlockCreateInsts
> +EDBlockEvaluateOperand
> +EDBlockVisitTokens
>
> Modified: llvm/trunk/tools/edis/Makefile
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/edis/Makefile?rev=101399&r1=101398&r2=101399&view=diff
>
> ==============================================================================
> --- llvm/trunk/tools/edis/Makefile (original)
> +++ llvm/trunk/tools/edis/Makefile Thu Apr 15 15:54:25 2010
> @@ -12,6 +12,8 @@
>
>  BUILT_SOURCES = EDInfo.inc
>
> +EXPORTED_SYMBOL_FILE = EnhancedDisassembly.exports
> +
>  # Include this here so we can get the configuration of the targets
>  # that have been configured for construction. We have to do this
>  # early so we can set up LINK_COMPONENTS before including Makefile.rules
> @@ -32,7 +34,6 @@
>     # extra options to override libtool defaults
>     LLVMLibsOptions    := $(LLVMLibsOptions)  \
>                          -avoid-version \
> -                         -Wl,-exported_symbols_list
> -Wl,$(PROJ_SRC_DIR)/EnhancedDisassembly.exports \
>                          -Wl,-dead_strip
>
>     ifdef EDIS_VERSION
>
> Modified: llvm/trunk/tools/lto/Makefile
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/Makefile?rev=101399&r1=101398&r2=101399&view=diff
>
> ==============================================================================
> --- llvm/trunk/tools/lto/Makefile (original)
> +++ llvm/trunk/tools/lto/Makefile Thu Apr 15 15:54:25 2010
> @@ -10,6 +10,8 @@
>  LEVEL = ../..
>  LIBRARYNAME = LTO
>
> +EXPORTED_SYMBOL_FILE = lto.exports
> +
>  # Include this here so we can get the configuration of the targets
>  # that have been configured for construction. We have to do this
>  # early so we can set up LINK_COMPONENTS before including Makefile.rules
> @@ -32,7 +34,6 @@
>     # extra options to override libtool defaults
>     LLVMLibsOptions    := $(LLVMLibsOptions)  \
>                          -avoid-version \
> -                         -Wl,-exported_symbols_list
> -Wl,$(PROJ_SRC_DIR)/lto.exports \
>                          -Wl,-dead_strip \
>                          -Wl,-seg1addr -Wl,0xE0000000
>
>
> Modified: llvm/trunk/tools/lto/lto.exports
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/lto.exports?rev=101399&r1=101398&r2=101399&view=diff
>
> ==============================================================================
> --- llvm/trunk/tools/lto/lto.exports (original)
> +++ llvm/trunk/tools/lto/lto.exports Thu Apr 15 15:54:25 2010
> @@ -1,24 +1,23 @@
> -_lto_get_error_message
> -_lto_get_version
> -_lto_module_create
> -_lto_module_create_from_memory
> -_lto_module_get_num_symbols
> -_lto_module_get_symbol_attribute
> -_lto_module_get_symbol_name
> -_lto_module_get_target_triple
> -_lto_module_is_object_file
> -_lto_module_is_object_file_for_target
> -_lto_module_is_object_file_in_memory
> -_lto_module_is_object_file_in_memory_for_target
> -_lto_module_dispose
> -_lto_codegen_add_module
> -_lto_codegen_add_must_preserve_symbol
> -_lto_codegen_compile
> -_lto_codegen_create
> -_lto_codegen_dispose
> -_lto_codegen_set_debug_model
> -_lto_codegen_set_pic_model
> -_lto_codegen_write_merged_modules
> -_lto_codegen_debug_options
> -_lto_codegen_set_assembler_path
> -
> +lto_get_error_message
> +lto_get_version
> +lto_module_create
> +lto_module_create_from_memory
> +lto_module_get_num_symbols
> +lto_module_get_symbol_attribute
> +lto_module_get_symbol_name
> +lto_module_get_target_triple
> +lto_module_is_object_file
> +lto_module_is_object_file_for_target
> +lto_module_is_object_file_in_memory
> +lto_module_is_object_file_in_memory_for_target
> +lto_module_dispose
> +lto_codegen_add_module
> +lto_codegen_add_must_preserve_symbol
> +lto_codegen_compile
> +lto_codegen_create
> +lto_codegen_dispose
> +lto_codegen_set_debug_model
> +lto_codegen_set_pic_model
> +lto_codegen_write_merged_modules
> +lto_codegen_debug_options
> +lto_codegen_set_assembler_path
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20100416/2abb3f94/attachment.html>


More information about the llvm-commits mailing list