[PATCH] D12316: Fixing compiler_rt makefile for architecture i686.

Nishanth H. Kottary via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 27 02:21:42 PDT 2015


nishanth-kottary updated this revision to Diff 33305.
nishanth-kottary added a comment.

Added code handle i686 architecture in makefiles. Built files will now have i686 in their names.


Repository:
  rL LLVM

http://reviews.llvm.org/D12316

Files:
  lib/builtins/i386/Makefile.mk
  make/platform/clang_linux.mk

Index: make/platform/clang_linux.mk
===================================================================
--- make/platform/clang_linux.mk
+++ make/platform/clang_linux.mk
@@ -21,7 +21,7 @@
 
 # Define configs only if arch in triple is i386 or x86_64
 CompilerTargetArch := $(firstword $(subst -, ,$(CompilerTargetTriple)))
-ifeq ($(call contains,i386 x86_64,$(CompilerTargetArch)),true)
+ifeq ($(call contains,i386 i686 x86_64,$(CompilerTargetArch)),true)
 
 # TryCompile compiler source flags
 # Returns exit code of running a compiler invocation.
@@ -35,8 +35,8 @@
     echo $$?)
 
 test_source = $(ProjSrcRoot)/make/platform/clang_linux_test_input.c
-ifeq ($(CompilerTargetArch),i386)
-  SupportedArches := i386
+ifeq ($(call contains,i386 i686,$(CompilerTargetArch)),true)
+  SupportedArches := $(CompilerTargetArch)
   ifeq ($(call TryCompile,$(CC),$(test_source),-m64),0)
     SupportedArches += x86_64
   endif
@@ -54,6 +54,13 @@
 Arch.profile-i386 := i386
 endif
 
+# Build runtime libraries for i686.
+ifeq ($(call contains,$(SupportedArches),i686),true)
+Configs += builtins-i686 profile-i686
+Arch.builtins-i686 := i686
+Arch.profile-i686 := i686
+endif
+
 # Build runtime libraries for x86_64.
 ifeq ($(call contains,$(SupportedArches),x86_64),true)
 Configs += builtins-x86_64 profile-x86_64
@@ -70,15 +77,21 @@
 CFLAGS := -Wall -Werror -O3 -fomit-frame-pointer
 
 CFLAGS.builtins-i386 := $(CFLAGS) -m32
+CFLAGS.builtins-i686 := $(CFLAGS) -m32
 CFLAGS.builtins-x86_64 := $(CFLAGS) -m64
 CFLAGS.profile-i386 := $(CFLAGS) -m32
+CFLAGS.profile-i686 := $(CFLAGS) -m32
 CFLAGS.profile-x86_64 := $(CFLAGS) -m64
 
 FUNCTIONS.builtins-i386 := $(CommonFunctions) $(ArchFunctions.i386)
+FUNCTIONS.builtins-i686 := $(CommonFunctions) $(ArchFunctions.i686)
 FUNCTIONS.builtins-x86_64 := $(CommonFunctions) $(ArchFunctions.x86_64)
 FUNCTIONS.profile-i386 := GCDAProfiling InstrProfiling InstrProfilingBuffer \
                           InstrProfilingFile InstrProfilingPlatformOther \
                           InstrProfilingRuntime InstrProfilingUtil
+FUNCTIONS.profile-i686 := GCDAProfiling InstrProfiling InstrProfilingBuffer \
+                          InstrProfilingFile InstrProfilingPlatformOther \
+                          InstrProfilingRuntime InstrProfilingUtil
 FUNCTIONS.profile-x86_64 := $(FUNCTIONS.profile-i386)
 
 # Always use optimized variants.
Index: lib/builtins/i386/Makefile.mk
===================================================================
--- lib/builtins/i386/Makefile.mk
+++ lib/builtins/i386/Makefile.mk
@@ -9,7 +9,7 @@
 
 ModuleName := builtins
 SubDirs := 
-OnlyArchs := i386
+OnlyArchs := i386 i686
 
 AsmSources := $(foreach file,$(wildcard $(Dir)/*.S),$(notdir $(file)))
 Sources := $(foreach file,$(wildcard $(Dir)/*.c),$(notdir $(file)))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12316.33305.patch
Type: text/x-patch
Size: 2781 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150827/5181681e/attachment.bin>


More information about the llvm-commits mailing list