Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -190,10 +190,32 @@ if test x"$enable_static" = x"yes" \ -o x"$enable_shared" = x"no"; then AC_SUBST(RUNTIME_A, "runtime.a") AC_SUBST(RUNTIME_RUNTIME_A, "runtime/runtime.a") fi + + AC_EGREP_CPP(yes, [ + #if defined(__amd64__) || defined(__x86_64__) + # ifdef __ELF__ + yes + # endif + #endif + ], [ + AC_SUBST(LOOKUP_S, lookup-amd64-elf.S) + AC_DEFINE(OF_ASM_LOOKUP, 1, + [Whether to use lookup in assembly]) + ], [ + AC_EGREP_CPP(yes, [ + #if defined(__i386__) && defined(__ELF__) + yes + #endif + ], [ + AC_SUBST(LOOKUP_S, lookup-x86-elf.S) + AC_DEFINE(OF_ASM_LOOKUP, 1, + [Whether to use lookup in assembly]) + ]) + ]) ;; "Apple runtime") AC_DEFINE(OF_APPLE_RUNTIME, 1, [Whether we use the Apple ObjC runtime]) Index: extra.mk.in ================================================================== --- extra.mk.in +++ extra.mk.in @@ -10,10 +10,11 @@ EXCEPTIONS_A = @EXCEPTIONS_A@ EXCEPTIONS_EXCEPTIONS_A = @EXCEPTIONS_EXCEPTIONS_A@ EXCEPTIONS_EXCEPTIONS_LIB_A = @EXCEPTIONS_EXCEPTIONS_LIB_A@ EXCEPTIONS_LIB_A = @EXCEPTIONS_LIB_A@ FOUNDATION_COMPAT_M = @FOUNDATION_COMPAT_M@ +LOOKUP_S = @LOOKUP_S@ MACH_ALIAS_LIST = @MACH_ALIAS_LIST@ OFBLOCKTESTS_M = @OFBLOCKTESTS_M@ OBJC_PROPERTIES_M = @OBJC_PROPERTIES_M@ OBJC_SYNC_M = @OBJC_SYNC_M@ OFHTTPREQUESTTESTS_M = @OFHTTPREQUESTTESTS_M@ Index: src/runtime/Makefile ================================================================== --- src/runtime/Makefile +++ src/runtime/Makefile @@ -6,12 +6,11 @@ SRCS = category.m \ class.m \ hashtable.m \ init.m \ lookup.m \ - lookup-amd64-elf.S \ - lookup-x86-elf.S \ + ${LOOKUP_S} \ property.m \ protocol.m \ selector.m \ sparsearray.m \ static-instances.m \ Index: src/runtime/lookup-amd64-elf.S ================================================================== --- src/runtime/lookup-amd64-elf.S +++ src/runtime/lookup-amd64-elf.S @@ -12,12 +12,10 @@ * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ -#if defined(__x86_64__) && defined(__ELF__) - .globl objc_msg_lookup .globl objc_msg_lookup_super .section .text objc_msg_lookup: @@ -66,7 +64,5 @@ .type objc_msg_lookup, @function .type objc_msg_lookup_super, @function .size objc_msg_lookup, forward-objc_msg_lookup .size objc_msg_lookup_super, ret_nil-objc_msg_lookup_super - -#endif Index: src/runtime/lookup-x86-elf.S ================================================================== --- src/runtime/lookup-x86-elf.S +++ src/runtime/lookup-x86-elf.S @@ -12,12 +12,10 @@ * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ -#if defined(__i386__) && defined(__ELF__) - .globl objc_msg_lookup .globl objc_msg_lookup_super .section .text objc_msg_lookup: @@ -74,7 +72,5 @@ .type objc_msg_lookup, @function .type objc_msg_lookup_super, @function .size objc_msg_lookup, forward-objc_msg_lookup .size objc_msg_lookup_super, ret_nil-objc_msg_lookup_super - -#endif Index: src/runtime/lookup.m ================================================================== --- src/runtime/lookup.m +++ src/runtime/lookup.m @@ -41,11 +41,11 @@ return (objc_sparsearray_get(cls->dtable, (uint32_t)sel->uid) != NULL ? YES : NO); } -#if !defined(__ELF__) || (!defined(OF_X86_ASM) && !defined(OF_AMD64_ASM)) +#ifndef OF_ASM_LOOKUP static id nil_method(id self, SEL _cmd) { return nil; }