Skip to content

Instantly share code, notes, and snippets.

@andyli
Created March 15, 2014 15:53
Show Gist options
  • Select an option

  • Save andyli/9569380 to your computer and use it in GitHub Desktop.

Select an option

Save andyli/9569380 to your computer and use it in GitHub Desktop.
From c83068bd7b95b3e29b2edc9410cea4b14625f3aa Mon Sep 17 00:00:00 2001
From: Jeremie Dimino <jdimino@janestreet.com>
Date: Wed, 12 Mar 2014 14:39:21 +0000
Subject: [PATCH] Do not pass -fno-defer-pop to clang
---
configure | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/configure b/configure
index d45e88f..e5a0bf4 100755
--- a/configure
+++ b/configure
@@ -321,6 +321,17 @@ case "$bytecc,$target" in
# Almost the same as NeXTStep
bytecccompopts="-fno-defer-pop $gcc_warnings -DSHRINKED_GNUC"
mathlib="";;
+ *clang,*-*-darwin*)
+ # -fno-defer-pop is not supported by clang, and make recent
+ # versions of clang to fail.
+ bytecccompopts="$gcc_warnings"
+ mathlib=""
+ mkexe="$mkexe -Wl,-no_compact_unwind"
+ # Tell gcc that we can use 32-bit code addresses for threaded code
+ # unless we are compiled for a shared library (-fPIC option)
+ echo "#ifndef __PIC__" >> m.h
+ echo "# define ARCH_CODE32" >> m.h
+ echo "#endif" >> m.h;;
*,*-*-darwin*)
bytecccompopts="-fno-defer-pop $gcc_warnings"
mathlib=""
--
1.8.4.2
From 73be7477f9b0f279fc2b20c7016dc95836b8c4b7 Mon Sep 17 00:00:00 2001
From: Jeremie Dimino <jdimino@janestreet.com>
Date: Wed, 12 Mar 2014 16:16:15 +0000
Subject: [PATCH] Check if gcc is an alias to clang
---
configure | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
diff --git a/configure b/configure
index e5a0bf4..5f22143 100755
--- a/configure
+++ b/configure
@@ -321,19 +321,15 @@ case "$bytecc,$target" in
# Almost the same as NeXTStep
bytecccompopts="-fno-defer-pop $gcc_warnings -DSHRINKED_GNUC"
mathlib="";;
- *clang,*-*-darwin*)
- # -fno-defer-pop is not supported by clang, and make recent
- # versions of clang to fail.
- bytecccompopts="$gcc_warnings"
- mathlib=""
- mkexe="$mkexe -Wl,-no_compact_unwind"
- # Tell gcc that we can use 32-bit code addresses for threaded code
- # unless we are compiled for a shared library (-fPIC option)
- echo "#ifndef __PIC__" >> m.h
- echo "# define ARCH_CODE32" >> m.h
- echo "#endif" >> m.h;;
*,*-*-darwin*)
- bytecccompopts="-fno-defer-pop $gcc_warnings"
+ # On recent version of OSX, gcc is a symlink to clang
+ if $bytecc --version | grep -q ^clang; then
+ # -fno-defer-pop is not supported by clang, and make recent
+ # versions of clang to fail
+ bytecccompopts="$gcc_warnings"
+ else
+ bytecccompopts="-fno-defer-pop $gcc_warnings"
+ fi
mathlib=""
mkexe="$mkexe -Wl,-no_compact_unwind"
# Tell gcc that we can use 32-bit code addresses for threaded code
--
1.8.4.2
From f2fd13b96528323270c35c4a221032beb7c4e91f Mon Sep 17 00:00:00 2001
From: Jeremie Dimino <jdimino@janestreet.com>
Date: Wed, 12 Mar 2014 16:18:49 +0000
Subject: [PATCH] Relax the clang check
---
configure | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure b/configure
index 5f22143..25d872b 100755
--- a/configure
+++ b/configure
@@ -323,7 +323,7 @@ case "$bytecc,$target" in
mathlib="";;
*,*-*-darwin*)
# On recent version of OSX, gcc is a symlink to clang
- if $bytecc --version | grep -q ^clang; then
+ if $bytecc --version | grep -q clang; then
# -fno-defer-pop is not supported by clang, and make recent
# versions of clang to fail
bytecccompopts="$gcc_warnings"
--
1.8.4.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment