[pypy-commit] pypy default: Darwin: make 32bit/64bit compiler distinction more general

krono noreply at buildbot.pypy.org
Mon Jul 20 11:30:05 CEST 2015


Author: Tobias Pape <tobias at netshed.de>
Branch: 
Changeset: r78606:b5e4276e0872
Date: 2015-07-20 11:29 +0200
http://bitbucket.org/pypy/pypy/changeset/b5e4276e0872/

Log:	Darwin: make 32bit/64bit compiler distinction more general

	pdb/lldebug: do not depend on prctl on non-Linux

diff --git a/rpython/rtyper/module/ll_pdb.py b/rpython/rtyper/module/ll_pdb.py
--- a/rpython/rtyper/module/ll_pdb.py
+++ b/rpython/rtyper/module/ll_pdb.py
@@ -16,13 +16,19 @@
 
 
 if not _WIN32:
-    eci = ExternalCompilationInfo(includes=['string.h', 'assert.h', 'sys/prctl.h'],
-                                  post_include_bits=["""
+    import sys
+    if sys.platform.startswith('linux'):
+        # Only necessary on Linux
+        eci = ExternalCompilationInfo(includes=['string.h', 'assert.h', 'sys/prctl.h'],
+                                      post_include_bits=["""
 static void pypy__allow_attach(void) {
     prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY);
     return;
 }
-    """])
+        """])
+    else:
+        # Do nothing, there's no prctl
+        eci = ExternalCompilationInfo(post_include_bits=["static void pypy__allow_attach(void) { return; }"])
 
     allow_attach= rffi.llexternal(
         "pypy__allow_attach", [], lltype.Void,
diff --git a/rpython/translator/platform/darwin.py b/rpython/translator/platform/darwin.py
--- a/rpython/translator/platform/darwin.py
+++ b/rpython/translator/platform/darwin.py
@@ -67,9 +67,9 @@
 
 class Darwin_i386(Darwin):
     name = "darwin_i386"
-    link_flags = ('-arch', 'i386', '-mmacosx-version-min=10.4')
-    cflags = ('-arch', 'i386', '-O3', '-fomit-frame-pointer',
-              '-mmacosx-version-min=10.4')
+    DEFAULT_CC = 'clang -arch i386'
+    link_flags = ('-mmacosx-version-min=10.4',)
+    cflags = ('-O3', '-fomit-frame-pointer', '-mmacosx-version-min=10.4')
 
 class Darwin_PowerPC(Darwin):#xxx fixme, mwp
     name = "darwin_powerpc"
@@ -78,6 +78,6 @@
 
 class Darwin_x86_64(Darwin):
     name = "darwin_x86_64"
-    link_flags = ('-arch', 'x86_64', '-mmacosx-version-min=10.5')
-    cflags = ('-arch', 'x86_64', '-O3', '-fomit-frame-pointer',
-              '-mmacosx-version-min=10.5')
+    DEFAULT_CC = 'clang -arch x86_64'
+    link_flags = ('-mmacosx-version-min=10.5',)
+    cflags = ('-O3', '-fomit-frame-pointer', '-mmacosx-version-min=10.5')


More information about the pypy-commit mailing list