Ticket #34385: gcc-4.7.2.patch

File gcc-4.7.2.patch, 1.7 KB (added by internetzel, 12 years ago)

This patch should be applied to gcc when using ld64 as the linker. It makes the long-branch warning go away and produces the best suitable code for ld64.

  • gcc/config/darwin-driver.c

    diff -ru a/gcc/config/darwin-driver.c b/config/darwin-driver.c
    a b  
    7171 
    7272  /* The major kernel version number is 4 plus the second OS version
    7373     component.  */
     74#ifdef USE_LD32
    7475  if (major_vers - 4 <= 4)
    7576    /* On 10.4 and earlier, the old linker is used which does not
    7677       support three-component system versions.  */
    7778    sprintf (new_flag, "10.%d", major_vers - 4);
    7879  else
     80#endif
    7981    sprintf (new_flag, "10.%d.%s", major_vers - 4,
    8082             minor_vers);
    8183
  • gcc/config/darwin.c

    diff -ru a/gcc/config/darwin.c b/gcc/config/darwin.c
    a b  
    29382938        generating_for_darwin_version = 10;
    29392939      else if (strverscmp (darwin_macosx_version_min, "10.5") >= 0)
    29402940        generating_for_darwin_version = 9;
     2941#ifndef USE_LD32
     2942      else if (strverscmp (darwin_macosx_version_min, "10.4") >= 0)
     2943        generating_for_darwin_version = 9;
     2944#endif
    29412945
    29422946      /* Earlier versions are not specifically accounted, until required.  */
    29432947    }
  • libgcc/config/rs6000/t-darwin

    diff -ru a/libgcc/config/rs6000/t-darwin b/libgcc/config/rs6000/t-darwin
    a b  
    1 DARWIN_EXTRA_CRT_BUILD_CFLAGS = -mlongcall -mmacosx-version-min=10.4
     1DARWIN_EXTRA_CRT_BUILD_CFLAGS = -mmacosx-version-min=10.4
     2ifeq ($(USE_LD32),1)
     3DARWIN_EXTRA_CRT_BUILD_CFLAGS += -mlongcall
     4endif
    25
    36crt2.o: $(srcdir)/config/rs6000/darwin-crt2.c
    47        $(crt_compile) $(DARWIN_EXTRA_CRT_BUILD_CFLAGS) -c $<