Changeset 136963


Ignore:
Timestamp:
Jun 1, 2015, 6:27:59 AM (2 years ago)
Author:
larryv@…
Message:

apple-gcc42: Fix build on Yosemite (#45449)

It lives!

  • Remove kernel version check to stop the driver from complaining about Darwin 14 and later.
  • Fix interpretation of OS X and iOS deployment targets by adapting my upstream fix,† which I'm relicensing under GPLv2 for this purpose.
  • Stub out unrecognized macros in /usr/include/xpc/base.h.

https://gcc.gnu.org/viewcvs/gcc?limit_changes=0&view=rev&rev=223808

Location:
trunk/dports/lang/apple-gcc42
Files:
1 edited
4 copied

Legend:

Unmodified
Added
Removed
  • trunk/dports/lang/apple-gcc42/Portfile

    r136067 r136963  
    77version                 5666.3
    88set gcc_version         4.2.1
    9 revision                14
     9revision                15
    1010categories              lang
    1111platforms               darwin
     
    7373depends_run             port:gcc_select
    7474
    75 platform darwin {
    76     if {${os.major} >= 14} {
    77         depends_lib
    78         depends_run
    79         pre-fetch {
    80             ui_error "$name is not supported on Yosemite or later."
    81             error "unsupported platform"
    82         }
    83     }
    84 }
    85 
    8675use_configure no
    8776variant universal {}
     
    10695# driverdriver-armcheck.patch        : Build fix for the driverdriver when arm support is not available (eg: Tiger)
    10796# tiger-Unwind_GetIPInfo.patch       : https://trac.macports.org/ticket/36226
    108 # yosemite-deployment-target.patch   : https://trac.macports.org/ticket/43978
     97# remove-kernel-version-check.patch  : Don't complain about Yosemite and later (#45449)
     98# version-min.patch                  : Interpret OS X and iOS versions correctly (#43978, #45449)
     99# autogen.patch                      : Update to work with modern AutoGen (necessary to create fixincludes.patch)
     100# fixincludes.patch                  : Stub out unrecognized macros in system headers (#45449)
    109101
    110102patchfiles-append \
    111         yosemite-deployment-target.patch \
    112103        werror-c-incpath.patch \
    113104        werror-local-alloc.patch \
     
    115106        driverdriver-num_infiles.patch \
    116107        driverdriver-armcheck.patch \
    117         tiger-Unwind_GetIPInfo.patch
     108        tiger-Unwind_GetIPInfo.patch \
     109        remove-kernel-version-check.patch \
     110        version-min.patch \
     111        autogen.patch \
     112        fixincludes.patch
    118113
    119114# gcj fails to build:
  • trunk/dports/lang/apple-gcc42/files/autogen.patch

    • Property svn:mergeinfo set to (toggle deleted branches)
      /branches/mld-qt-481/dports/lang/llvm-gcc42/files/autogen.patch92720,​92813,​92891,​92963,​93522,​93556,​93699,​93743,​93771-93773,​93806,​93817-93818,​93856
    r136962 r136963  
    1212   echo "AutoGen appears to be out of date or not correctly installed."
    1313   echo "Please download and install:"
     14Index: fixincludes/inclhack.def
     15===================================================================
     16--- fixincludes/inclhack.def.orig
     17+++ fixincludes/inclhack.def
     18@@ -1108,8 +1108,8 @@ fix = {
     19  */
     20 fix = {
     21     hackname  = bsd_stdio_attrs_conflict;
     22-    mach      = *-*-*bsd*;
     23-    mach      = *-*-*darwin*;
     24+    mach      = "*-*-*bsd*";
     25+    mach      = "*-*-*darwin*";
     26     files     = stdio.h;
     27     select    = "^#define[ \t]*vfscanf[ \t]*__svfscanf[ \t]*$";
     28     c_fix     = format;
     29@@ -1364,7 +1364,7 @@ fix = {
     30  */
     31 fix = {
     32     hackname  = freebsd_gcc3_breakage;
     33-    mach      = *-*-freebsd*;
     34+    mach      = "*-*-freebsd*";
     35     files     = sys/cdefs.h;
     36     select    = '^#if __GNUC__ == 2 && __GNUC_MINOR__ >= 7$';
     37     bypass    = '__GNUC__[ \t]*([>=]=[ \t]*[3-9]|>[ \t]*2)';
     38@@ -1381,7 +1381,7 @@ fix = {
     39  */
     40 fix = {
     41     hackname  = freebsd_gcc4_breakage;
     42-    mach      = *-*-freebsd*;
     43+    mach      = "*-*-freebsd*";
     44     files     = sys/cdefs.h;
     45     select    = '^#if __GNUC__ == 2 && __GNUC_MINOR__ >= 7 \|\| __GNUC__ == 3$';
     46     c_fix     = format;
     47@@ -1656,7 +1656,7 @@ fix = {
     48  */
     49 fix = {
     50     hackname  = hpux11_abs;
     51-    mach      = ia64-hp-hpux11*;
     52+    mach      = "ia64-hp-hpux11*";
     53     files     = stdlib.h;
     54     select    = "ifndef _MATH_INCLUDED";
     55     c_fix     = format;
     56@@ -2590,7 +2590,7 @@ fix = {
     57  */
     58 fix = {
     59     hackname  = netbsd_extra_semicolon;
     60-    mach      = *-*-netbsd*;
     61+    mach      = "*-*-netbsd*";
     62     files     = sys/cdefs.h;
     63     select    = "#define[ \t]*__END_DECLS[ \t]*};";
     64 
  • trunk/dports/lang/apple-gcc42/files/fixincludes.patch

    • Property svn:mergeinfo set to (toggle deleted branches)
      /branches/mld-qt-481/dports/lang/llvm-gcc42/files/fixincludes.patch92720,​92813,​92891,​92963,​93522,​93556,​93699,​93743,​93771-93773,​93806,​93817-93818,​93856
    r136962 r136963  
    66--- fixincludes/inclhack.def.orig
    77+++ fixincludes/inclhack.def
    8 @@ -1221,6 +1221,31 @@ fix = {
     8@@ -1206,6 +1206,31 @@ fix = {
    99 };
    1010 
     
    4848  * DO NOT EDIT THIS FILE   (fixincl.x)
    4949- *
    50 - * It has been AutoGen-ed  Friday July 17, 2009 at 11:13:21 AM CEST
     50- * It has been AutoGen-ed  Friday July 20, 2007 at 02:14:34 PM PDT
    5151+ *
    5252+ * It has been AutoGen-ed
     
    5454  * and the template file   fixincl
    5555  */
    56 -/* DO NOT SVN-MERGE THIS FILE, EITHER Fri Jul 17 11:13:21 CEST 2009
    57 +/* DO NOT SVN-MERGE THIS FILE, EITHER Sun May 31 21:20:28 EDT 2015
     56-/* DO NOT CVS-MERGE THIS FILE, EITHER Fri Jul 20 14:14:34 PDT 2007
     57+/* DO NOT CVS-MERGE THIS FILE, EITHER Mon Jun  1 01:47:00 EDT 2015
    5858  *
    5959  * You must regenerate it.  Use the ./genfixes script.
     
    6363  * correctly with ANSI C and placed in a directory that GNU C will search.
    6464  *
    65 - * This file contains 217 fixup descriptions.
    66 + * This file contains 219 fixup descriptions.
     65- * This file contains 209 fixup descriptions.
     66+ * This file contains 211 fixup descriptions.
    6767  *
    6868  * See README for more information.
     
    100100 
    101101 /* * * * * * * * * * * * * * * * * * * * * * * * * *
    102 @@ -1960,6 +1956,80 @@ static const char* apzDarwin_Gcc4_Breaka
     102@@ -1957,6 +1953,80 @@ static const char* apzDarwin_Gcc4_Breaka
    103103 
    104104 /* * * * * * * * * * * * * * * * * * * * * * * * * *
     
    113113+ */
    114114+tSCC zDarwin_Has_ExtensionList[] =
    115 +  "xpc/base.h\0";
     115+  "|xpc/base.h|";
    116116+/*
    117117+ *  Machine/OS name selection pattern
     
    150150+ */
    151151+tSCC zDarwin_Has_FeatureList[] =
    152 +  "xpc/base.h\0";
     152+  "|xpc/base.h|";
    153153+/*
    154154+ *  Machine/OS name selection pattern
     
    181181  */
    182182 tSCC zDarwin_Macho_Swaph_ExterncName[] =
    183 @@ -4652,13 +4722,10 @@ tSCC zMath_ExceptionSelect0[] =
    184   */
    185  tSCC zMath_ExceptionBypass0[] =
    186         "We have a problem when using C\\+\\+|for C\\+\\+, _[a-z0-9A-Z_]+_exception; for C, exception";
    187 -tSCC zMath_ExceptionBypass1[] =
    188 -       "defined __cplusplus";
    189  
    190  #define    MATH_EXCEPTION_TEST_CT  2
    191  static tTestDesc aMath_ExceptionTests[] = {
    192    { TT_NEGREP,   zMath_ExceptionBypass0, (regex_t*)NULL },
    193 -  { TT_NEGREP,   zMath_ExceptionBypass1, (regex_t*)NULL },
    194    { TT_EGREP,    zMath_ExceptionSelect0, (regex_t*)NULL }, };
    195  
    196  /*
    197 @@ -8842,9 +8909,9 @@ static const char* apzGlibc_Fdzero_Inlin
     183@@ -8511,9 +8581,9 @@ static const char* apzX11_SprintfPatch[]
    198184  *
    199185  *  List of all fixes
    200186  */
    201 -#define REGEX_COUNT          262
    202 +#define REGEX_COUNT          264
     187-#define REGEX_COUNT          251
     188+#define REGEX_COUNT          253
    203189 #define MACH_LIST_SIZE_LIMIT 261
    204 -#define FIX_COUNT            217
    205 +#define FIX_COUNT            219
     190-#define FIX_COUNT            209
     191+#define FIX_COUNT            211
    206192 
    207193 /*
    208194  *  Enumerate the fixes
    209 @@ -8894,6 +8961,8 @@ typedef enum {
     195@@ -8563,6 +8633,8 @@ typedef enum {
    210196     CTRL_QUOTES_USE_FIXIDX,
    211197     CXX_UNREADY_FIXIDX,
     
    216202     DARWIN_PRIVATE_EXTERN_FIXIDX,
    217203     DARWIN_STDINT_GUARDS_INTN_FIXIDX,
    218 @@ -9290,6 +9359,16 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
     204@@ -8951,6 +9023,16 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
    219205      DARWIN_GCC4_BREAKAGE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
    220206      aDarwin_Gcc4_BreakageTests,   apzDarwin_Gcc4_BreakagePatch, 0 },
  • trunk/dports/lang/apple-gcc42/files/version-min.patch

    r136962 r136963  
    4646        * gcc/testsuite/gcc.dg/darwin-minversion-12.c: Ditto.
    4747---
    48 Adapted for LLVM-GCC 4.2.1 (2336.11) from my upstream trunk fix.
     48Adapted for GCC 4.2.1 (Apple 5666.3) from my upstream trunk fix.
    4949Extended to fix handling of iOS deployment targets.
    5050
     
    6464--- gcc/config/darwin-c.c.orig
    6565+++ gcc/config/darwin-c.c
    66 @@ -816,35 +816,158 @@ find_subframework_header (cpp_reader *pf
     66@@ -927,35 +927,158 @@ find_subframework_header (cpp_reader *pf
    6767   return 0;
    6868 }
     
    244244  fail:
    245245   error ("Unknown value %qs of -mmacosx-version-min",
    246 @@ -863,62 +986,21 @@ macosx_version_as_macro (void)
     246@@ -974,62 +1097,21 @@ macosx_version_as_macro (void)
    247247 static const char *
    248248 iphoneos_version_as_macro (void)
     
    315315  fail:
    316316   error ("Unknown value %qs of -miphoneos-version-min",
    317 Index: gcc/testsuite/gcc.dg/darwin-minversion-10.c
    318 ===================================================================
    319 --- /dev/null
    320 +++ gcc/testsuite/gcc.dg/darwin-minversion-10.c
    321 @@ -0,0 +1,16 @@
    322 +/* PR target/63810: Test that an OS X minimum version with zero-padded
    323 +   minor and tiny numbers less than 10 produces the correct
    324 +   four-character macro.  */
    325 +/* Added by Lawrence Velázquez <vq@larryv.me>.  */
    326 +
    327 +/* { dg-options "-mmacosx-version-min=10.07.02" } */
    328 +/* { dg-do compile { target *-*-darwin* } } */
    329 +
    330 +int
    331 +main ()
    332 +{
    333 +#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 1072
    334 +  fail me;
    335 +#endif
    336 +  return 0;
    337 +}
    338 Index: gcc/testsuite/gcc.dg/darwin-minversion-11.c
    339 ===================================================================
    340 --- /dev/null
    341 +++ gcc/testsuite/gcc.dg/darwin-minversion-11.c
    342 @@ -0,0 +1,16 @@
    343 +/* PR target/63810: Test that an OS X minimum version with outrageous
    344 +   zero-padding and a minor number greater than 9 still produces
    345 +   a six-character macro.  */
    346 +/* Added by Lawrence Velázquez <vq@larryv.me>.  */
    347 +
    348 +/* { dg-options "-mmacosx-version-min=00010.010.0000098" } */
    349 +/* { dg-do compile { target *-*-darwin* } } */
    350 +
    351 +int
    352 +main ()
    353 +{
    354 +#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 101098
    355 +  fail me;
    356 +#endif
    357 +  return 0;
    358 +}
    359 Index: gcc/testsuite/gcc.dg/darwin-minversion-12.c
    360 ===================================================================
    361 --- /dev/null
    362 +++ gcc/testsuite/gcc.dg/darwin-minversion-12.c
    363 @@ -0,0 +1,16 @@
    364 +/* PR target/63810: Test that an OS X minimum version with outrageous
    365 +   zero-padding and a minor number less than 10 still produces
    366 +   a four-character macro.  */
    367 +/* Added by Lawrence Velázquez <vq@larryv.me>.  */
    368 +
    369 +/* { dg-options "-mmacosx-version-min=010.008.000031" } */
    370 +/* { dg-do compile { target *-*-darwin* } } */
    371 +
    372 +int
    373 +main ()
    374 +{
    375 +#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 1089
    376 +  fail me;
    377 +#endif
    378 +  return 0;
    379 +}
    380 Index: gcc/testsuite/gcc.dg/darwin-minversion-3.c
    381 ===================================================================
    382 --- /dev/null
    383 +++ gcc/testsuite/gcc.dg/darwin-minversion-3.c
    384 @@ -0,0 +1,12 @@
    385 +/* Test that most minor versions less than 10 work.  */
    386 +/* { dg-options "-mmacosx-version-min=10.4.1" } */
    387 +/* { dg-do compile { target *-*-darwin* } } */
    388 +
    389 +int
    390 +main ()
    391 +{
    392 +#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 1041
    393 +  fail me;
    394 +#endif
    395 +  return 0;
    396 +}
    397 Index: gcc/testsuite/gcc.dg/darwin-minversion-4.c
    398 ===================================================================
    399 --- /dev/null
    400 +++ gcc/testsuite/gcc.dg/darwin-minversion-4.c
    401 @@ -0,0 +1,12 @@
    402 +/* Test that minor versions greater than 9 produce a six-character macro.  */
    403 +/* { dg-options "-mmacosx-version-min=10.10.1" } */
    404 +/* { dg-do compile { target *-*-darwin* } } */
    405 +
    406 +int
    407 +main ()
    408 +{
    409 +#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 101001
    410 +  fail me;
    411 +#endif
    412 +  return 0;
    413 +}
    414 Index: gcc/testsuite/gcc.dg/darwin-minversion-5.c
    415 ===================================================================
    416 --- /dev/null
    417 +++ gcc/testsuite/gcc.dg/darwin-minversion-5.c
    418 @@ -0,0 +1,16 @@
    419 +/* PR target/63810: Test that an OS X minimum version with minor number
    420 +   less than 10 and tiny number greater than 9 produces a four-character
    421 +   macro with the tiny number clamped to 9.  */
    422 +/* Added by Lawrence Velázquez <vq@larryv.me>.  */
    423 +
    424 +/* { dg-options "-mmacosx-version-min=10.9.10" } */
    425 +/* { dg-do compile { target *-*-darwin* } } */
    426 +
    427 +int
    428 +main ()
    429 +{
    430 +#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 1099
    431 +  fail me;
    432 +#endif
    433 +  return 0;
    434 +}
    435 Index: gcc/testsuite/gcc.dg/darwin-minversion-6.c
    436 ===================================================================
    437 --- /dev/null
    438 +++ gcc/testsuite/gcc.dg/darwin-minversion-6.c
    439 @@ -0,0 +1,15 @@
    440 +/* PR target/63810: Test that tiny numbers are preserved in
    441 +   six-character macros.  */
    442 +/* Added by Lawrence Velázquez <vq@larryv.me>.  */
    443 +
    444 +/* { dg-options "-mmacosx-version-min=10.10.11" } */
    445 +/* { dg-do compile { target *-*-darwin* } } */
    446 +
    447 +int
    448 +main ()
    449 +{
    450 +#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 101011
    451 +  fail me;
    452 +#endif
    453 +  return 0;
    454 +}
    455 Index: gcc/testsuite/gcc.dg/darwin-minversion-7.c
    456 ===================================================================
    457 --- /dev/null
    458 +++ gcc/testsuite/gcc.dg/darwin-minversion-7.c
    459 @@ -0,0 +1,15 @@
    460 +/* PR target/63810: Test that tiny numbers less than 10 are preserved in
    461 +   four-character macros.  */
    462 +/* Added by Lawrence Velázquez <vq@larryv.me>.  */
    463 +
    464 +/* { dg-options "-mmacosx-version-min=10.9.1" } */
    465 +/* { dg-do compile { target *-*-darwin* } } */
    466 +
    467 +int
    468 +main ()
    469 +{
    470 +#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 1091
    471 +  fail me;
    472 +#endif
    473 +  return 0;
    474 +}
    475 Index: gcc/testsuite/gcc.dg/darwin-minversion-8.c
    476 ===================================================================
    477 --- /dev/null
    478 +++ gcc/testsuite/gcc.dg/darwin-minversion-8.c
    479 @@ -0,0 +1,16 @@
    480 +/* PR target/63810: Test that an OS X minimum version with minor number
    481 +   greater than 9 and no tiny number produces a six-character macro
    482 +   ending in "00".  */
    483 +/* Added by Lawrence Velázquez <vq@larryv.me>.  */
    484 +
    485 +/* { dg-options "-mmacosx-version-min=10.11" } */
    486 +/* { dg-do compile { target *-*-darwin* } } */
    487 +
    488 +int
    489 +main ()
    490 +{
    491 +#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 101100
    492 +  fail me;
    493 +#endif
    494 +  return 0;
    495 +}
    496 Index: gcc/testsuite/gcc.dg/darwin-minversion-9.c
    497 ===================================================================
    498 --- /dev/null
    499 +++ gcc/testsuite/gcc.dg/darwin-minversion-9.c
    500 @@ -0,0 +1,15 @@
    501 +/* PR target/63810: Test that an OS X minimum version with a zero-padded
    502 +   minor number less than 10 produces a four-character macro.  */
    503 +/* Added by Lawrence Velázquez <vq@larryv.me>.  */
    504 +
    505 +/* { dg-options "-mmacosx-version-min=10.08.4" } */
    506 +/* { dg-do compile { target *-*-darwin* } } */
    507 +
    508 +int
    509 +main ()
    510 +{
    511 +#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 1084
    512 +  fail me;
    513 +#endif
    514 +  return 0;
    515 +}
Note: See TracChangeset for help on using the changeset viewer.