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))) 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.