From 7e5d437065695a5b1ee5ff9d73a5b8dc922d1e71 Mon Sep 17 00:00:00 2001 From: qmathe Date: Fri, 11 Jan 2013 13:35:42 +0000 Subject: [PATCH] Restored r35794 changes (that were removed in r35893) but applied them to the GNUMakefile rather than the Makefile. This fixes segfaults in programs compiled with Clang using -fobjc-nonfragile-abi on Linux x86-32, for a GNUmakefile-based build with GNUstep Make active. --- GNUmakefile | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/GNUmakefile b/GNUmakefile index a653eeb..aba0cff 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -37,6 +37,28 @@ endif INSTALL := dummy_install include Makefile +include $(GNUSTEP_MAKEFILES)/names.make + +# Hack to support -03 for Clang and get the __sync_* GCC builtins work +# -O3 requires -march=i586 on Linux x86-32, otherwise Clang compiles +# programs that segfaults if -fobjc-nonfragile-abi is used. +ifeq ($(findstring linux, $(GNUSTEP_TARGET_OS)), linux) + ifeq ($(GNUSTEP_TARGET_CPU), ix86) + CFLAGS += -march=i586 + endif +endif + +# Hack to get mingw to provide declaration for strdup (since it is non-standard) +ifeq ($(GNUSTEP_TARGET_OS), mingw32) + ${LIBOBJC}_CPPFLAGS += -U__STRICT_ANSI__ +endif + +# Shouldn't be needed starting with OpenBSD 5.2 +ifeq ($(findstring openbsd, `$CC -dumpmachine`), openbsd) + LDFLAGS += -pthread +else + LDFLAGS += -lpthread +endif LIB_DIR := $(shell gnustep-config --variable=GNUSTEP_$(GNUSTEP_INSTALLATION_DOMAIN)_LIBRARIES 2>/dev/null) ifeq ($(LIB_DIR),)