From 28e92f3622eaf5ea28cb6226aa41cee8ad69681d Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Fri, 29 Apr 2011 12:59:00 +0100 Subject: [PATCH] Move the machdepCCOpts flags into cCcOpts This will ultimately mean they end up in the settings file, rather than being hardcoded. We now unconditionally give -D_REENTRANT on alpha, but I think that's probably the right thing to do nowadays anyway. --- aclocal.m4 | 15 +++++++++++++++ compiler/main/DynFlags.hs | 23 +---------------------- 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index 4b750ef..357c2e3 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -105,6 +105,21 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS], $4="$$4 -arch x86_64" $5="$$5 -m64" ;; + alpha-*) + # For now, to suppress the gcc warning "call-clobbered + # register used for global register variable", we simply + # disable all warnings altogether using the -w flag. Oh well. + $2="$$2 -w -mieee -D_REENTRANT" + $3="$$3 -w -mieee -D_REENTRANT" + $5="$$5 -w -mieee -D_REENTRANT" + ;; + hppa*) + # ___HPUX_SOURCE, not _HPUX_SOURCE, is #defined if -ansi! + # (very nice, but too bad the HP /usr/include files don't agree.) + $2="$$2 -D_HPUX_SOURCE" + $3="$$3 -D_HPUX_SOURCE" + $5="$$5 -D_HPUX_SOURCE" + ;; esac # If gcc knows about the stack protector, turn it off. diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 732d9b4..f5d4be3 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -2201,28 +2201,7 @@ setOptHpcDir arg = upd $ \ d -> d{hpcDir = arg} -- platform. machdepCCOpts :: DynFlags -> [String] -- flags for all C compilations -machdepCCOpts _ = cCcOpts ++ machdepCCOpts' - -machdepCCOpts' :: [String] -- flags for all C compilations -machdepCCOpts' -#if alpha_TARGET_ARCH - = ["-w", "-mieee" -#ifdef HAVE_THREADED_RTS_SUPPORT - , "-D_REENTRANT" -#endif - ] - -- For now, to suppress the gcc warning "call-clobbered - -- register used for global register variable", we simply - -- disable all warnings altogether using the -w flag. Oh well. - -#elif hppa_TARGET_ARCH - -- ___HPUX_SOURCE, not _HPUX_SOURCE, is #defined if -ansi! - -- (very nice, but too bad the HP /usr/include files don't agree.) - = ["-D_HPUX_SOURCE"] - -#else - = [] -#endif +machdepCCOpts _ = cCcOpts picCCOpts :: DynFlags -> [String] picCCOpts _dflags -- 1.7.10.4