NetBSD Problem Report #53691

From gson@gson.org  Tue Oct 30 13:36:24 2018
Return-Path: <gson@gson.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 0B49E7A14F
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 30 Oct 2018 13:36:24 +0000 (UTC)
Message-Id: <20181030133617.AC5F99893EB@guava.gson.org>
Date: Tue, 30 Oct 2018 15:36:17 +0200 (EET)
From: gson@gson.org (Andreas Gustafsson)
Reply-To: gson@gson.org (Andreas Gustafsson)
To: gnats-bugs@NetBSD.org
Subject: lang/gcc48 won't build on macOS 10.14
X-Send-Pr-Version: 3.95

>Number:         53691
>Category:       pkg
>Synopsis:       lang/gcc48 won't build on macOS 10.14
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    macos-pkg-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Oct 30 13:40:00 +0000 2018
>Last-Modified:  Fri Nov 08 14:25:01 +0000 2019
>Originator:     Andreas Gustafsson
>Release:        macOS Mojave 10.14
>Organization:
>Environment:
System: macOS Mojave 10.14
Architecture: x86_64
Machine: amd64
>Description:

Building lang/gcc48 on macOS 10.14 (aka Mojave) fails with:

  lipo -output libgcc_ext.10.4.dylib -create libgcc_ext.10.4.dylib_T*
  fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't open input file: libgcc_ext.10.4.dylib_T* (No such file or directory)

>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:
From: Andreas Gustafsson <gson@gson.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/53691: lang/gcc48 won't build on macOS 10.14
Date: Tue, 30 Oct 2018 19:01:21 +0200

 The build log is now at:

    http://www.gson.org/netbsd/bugs/53691/gcc48.log

 Change the version number in the URL for logs from other GCC
 versions that are also failing to build.
 -- 
 Andreas Gustafsson, gson@gson.org

Responsible-Changed-From-To: pkg-manager->macos-pkg-people
Responsible-Changed-By: hauke@NetBSD.org
Responsible-Changed-When: Wed, 31 Oct 2018 08:56:16 +0000
Responsible-Changed-Why:
Sounds like a MacOS X (sp?) problem.


From: maya@NetBSD.org
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/53691: lang/gcc48 won't build on macOS 10.14
Date: Sun, 20 Oct 2019 06:45:22 +0000

 Might be worth a shot

 ----- Forwarded message from Min Sik Kim <minskim@netbsd.org> -----

 Date: Sat, 19 Oct 2019 21:20:38 +0000
 From: Min Sik Kim <minskim@netbsd.org>
 To: pkgsrc-changes@NetBSD.org
 Subject: CVS commit: pkgsrc/lang/gcc8
 X-Mailer: log_accum

 Module Name:	pkgsrc
 Committed By:	minskim
 Date:		Sat Oct 19 21:20:38 UTC 2019

 Modified Files:
 	pkgsrc/lang/gcc8: distinfo
 Added Files:
 	pkgsrc/lang/gcc8/patches: patch-fixincludes_fixincl.x
 	    patch-fixincludes_inclhack.def

 Log Message:
 lang/gcc8: Make this build on macOS Catalina

 A patch from Homebrew:

 https://github.com/Homebrew/homebrew-core/pull/44762


 To generate a diff of this commit:
 cvs rdiff -u -r1.10 -r1.11 pkgsrc/lang/gcc8/distinfo
 cvs rdiff -u -r0 -r1.1 pkgsrc/lang/gcc8/patches/patch-fixincludes_fixincl.x \
     pkgsrc/lang/gcc8/patches/patch-fixincludes_inclhack.def

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.


 Modified files:

 Index: pkgsrc/lang/gcc8/distinfo
 diff -u pkgsrc/lang/gcc8/distinfo:1.10 pkgsrc/lang/gcc8/distinfo:1.11
 --- pkgsrc/lang/gcc8/distinfo:1.10	Tue Aug  6 06:16:15 2019
 +++ pkgsrc/lang/gcc8/distinfo	Sat Oct 19 21:20:38 2019
 @@ -1,4 +1,4 @@
 -$NetBSD: distinfo,v 1.10 2019/08/06 06:16:15 maya Exp $
 +$NetBSD: distinfo,v 1.11 2019/10/19 21:20:38 minskim Exp $

  SHA1 (gcc-8.3.0.tar.xz) = c27f4499dd263fe4fb01bcc5565917f3698583b2
  RMD160 (gcc-8.3.0.tar.xz) = 59396f7136301466d0ec15eb7307558c0da692df
 @@ -9,6 +9,8 @@ RMD160 (isl-0.16.1.tar.bz2) = 5a99db3fe0
  SHA512 (isl-0.16.1.tar.bz2) = c188667a84dc5bdddb4ab7c35f89c91bf15a8171f4fcaf41301cf285fb7328846d9a367c096012fec4cc69d244f0bc9e95d84c09ec097394cd4093076f2a041b
  Size (isl-0.16.1.tar.bz2) = 1626446 bytes
  SHA1 (patch-contrib_download__prerequisites) = 9cdcde21ab174052911447d20762ddfd40aa8791
 +SHA1 (patch-fixincludes_fixincl.x) = e78103bbc1783f18e39cab5f31a73767617b2a79
 +SHA1 (patch-fixincludes_inclhack.def) = 7bc5afb89118bf46c66a34a0f325f0748dd081db
  SHA1 (patch-gcc_Makefile.in) = c0f97c75ba1d37eae894141edd58bb36b734f651
  SHA1 (patch-gcc_config.gcc) = 4a971d1df7f05cfaefdf462d1b7c6dea1e838713
  SHA1 (patch-gcc_config_aarch64_aarch64-builtins.c) = b10ef4b9ad39e605fc4e2a0c8dffdae677842e94

 Added files:

 Index: pkgsrc/lang/gcc8/patches/patch-fixincludes_fixincl.x
 diff -u /dev/null pkgsrc/lang/gcc8/patches/patch-fixincludes_fixincl.x:1.1
 --- /dev/null	Sat Oct 19 21:20:38 2019
 +++ pkgsrc/lang/gcc8/patches/patch-fixincludes_fixincl.x	Sat Oct 19 21:20:38 2019
 @@ -0,0 +1,88 @@
 +$NetBSD: patch-fixincludes_fixincl.x,v 1.1 2019/10/19 21:20:38 minskim Exp $
 +
 +A workaround for Catalina SDK bug from
 +https://github.com/Homebrew/homebrew-core/pull/44762
 +
 +--- fixincludes/fixincl.x.orig	2018-02-22 08:12:26.000000000 -0800
 ++++ fixincludes/fixincl.x	2019-10-18 18:16:11.000000000 -0700
 +@@ -2584,6 +2584,48 @@
 + 
 + /* * * * * * * * * * * * * * * * * * * * * * * * * *
 +  *
 ++ *  Description of Darwin_Availability fix
 ++ */
 ++tSCC zDarwin_AvailabilityName[] =
 ++    "darwin_availability";
 ++
 ++/*
 ++ *  File name selection pattern
 ++ */
 ++tSCC zDarwin_AvailabilityList[] =
 ++  "Availability.h\0";
 ++/*
 ++ *  Machine/OS name selection pattern
 ++ */
 ++tSCC* apzDarwin_AvailabilityMachs[] = {
 ++        "*-*-darwin*",
 ++        (const char*)NULL };
 ++
 ++/*
 ++ *  content selection pattern - do fix if pattern found
 ++ */
 ++tSCC zDarwin_AvailabilitySelect0[] =
 ++       "#endif /\\* __OSX_AVAILABLE_STARTING \\*/";
 ++
 ++#define    DARWIN_AVAILABILITY_TEST_CT  1
 ++static tTestDesc aDarwin_AvailabilityTests[] = {
 ++  { TT_EGREP,    zDarwin_AvailabilitySelect0, (regex_t*)NULL }, };
 ++
 ++/*
 ++ *  Fix Command Arguments for Darwin_Availability
 ++ */
 ++static const char* apzDarwin_AvailabilityPatch[] = {
 ++    "format",
 ++    "#endif /* __OSX_AVAILABLE_STARTING */\n\
 ++#ifndef __OSX_AVAILABLE_STARTING\n\
 ++  #define __OSX_AVAILABLE_STARTING(_osx, _ios)\n\
 ++  #define __OSX_AVAILABLE_BUT_DEPRECATED(_osxIntro, _osxDep, _iosIntro, _iosDep)\n\
 ++  #define __OSX_AVAILABLE_BUT_DEPRECATED_MSG(_osxIntro, _osxDep, _iosIntro, _iosDep, _msg)\n\
 ++#endif",
 ++    (char*)NULL };
 ++
 ++/* * * * * * * * * * * * * * * * * * * * * * * * * *
 ++ *
 +  *  Description of Darwin_9_Long_Double_Funcs_2 fix
 +  */
 + tSCC zDarwin_9_Long_Double_Funcs_2Name[] =
 +@@ -10099,9 +10141,9 @@
 +  *
 +  *  List of all fixes
 +  */
 +-#define REGEX_COUNT          287
 ++#define REGEX_COUNT          288
 + #define MACH_LIST_SIZE_LIMIT 187
 +-#define FIX_COUNT            249
 ++#define FIX_COUNT            250
 + 
 + /*
 +  *  Enumerate the fixes
 +@@ -10168,6 +10210,7 @@
 +     CTRL_QUOTES_USE_FIXIDX,
 +     CXX_UNREADY_FIXIDX,
 +     DARWIN_AVAILABILITYINTERNAL_FIXIDX,
 ++    DARWIN_AVAILABILITY_FIXIDX,
 +     DARWIN_9_LONG_DOUBLE_FUNCS_2_FIXIDX,
 +     DARWIN_EXTERNC_FIXIDX,
 +     DARWIN_GCC4_BREAKAGE_FIXIDX,
 +@@ -10664,6 +10707,11 @@
 +      DARWIN_AVAILABILITYINTERNAL_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
 +      aDarwin_AvailabilityinternalTests,   apzDarwin_AvailabilityinternalPatch, 0 },
 + 
 ++  {  zDarwin_AvailabilityName,    zDarwin_AvailabilityList,
 ++     apzDarwin_AvailabilityMachs,
 ++     DARWIN_AVAILABILITY_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
 ++     aDarwin_AvailabilityTests,   apzDarwin_AvailabilityPatch, 0 },
 ++
 +   {  zDarwin_9_Long_Double_Funcs_2Name,    zDarwin_9_Long_Double_Funcs_2List,
 +      apzDarwin_9_Long_Double_Funcs_2Machs,
 +      DARWIN_9_LONG_DOUBLE_FUNCS_2_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
 Index: pkgsrc/lang/gcc8/patches/patch-fixincludes_inclhack.def
 diff -u /dev/null pkgsrc/lang/gcc8/patches/patch-fixincludes_inclhack.def:1.1
 --- /dev/null	Sat Oct 19 21:20:38 2019
 +++ pkgsrc/lang/gcc8/patches/patch-fixincludes_inclhack.def	Sat Oct 19 21:20:38 2019
 @@ -0,0 +1,36 @@
 +$NetBSD: patch-fixincludes_inclhack.def,v 1.1 2019/10/19 21:20:38 minskim Exp $
 +
 +A workaround for Catalina SDK bug from
 +https://github.com/Homebrew/homebrew-core/pull/44762
 +
 +--- fixincludes/inclhack.def.orig	2018-02-22 08:12:26.000000000 -0800
 ++++ fixincludes/inclhack.def	2019-10-18 18:17:01.000000000 -0700
 +@@ -1268,6 +1268,28 @@
 + };
 + 
 + /*
 ++ *  macOS 10.15 <Availability.h> does not define __OSX_AVAILABLE_STARTING on
 ++ *  non-clang compilers.
 ++ */
 ++fix = {
 ++    hackname  = darwin_availability;
 ++    mach      = "*-*-darwin*";
 ++    files     = Availability.h;
 ++    select    = "#endif /\\* __OSX_AVAILABLE_STARTING \\*/";
 ++    c_fix     = format;
 ++    c_fix_arg = <<- _EOFix_
 ++	#endif /* __OSX_AVAILABLE_STARTING */
 ++	#ifndef __OSX_AVAILABLE_STARTING
 ++	  #define __OSX_AVAILABLE_STARTING(_osx, _ios)
 ++	  #define __OSX_AVAILABLE_BUT_DEPRECATED(_osxIntro, _osxDep, _iosIntro, _iosDep)
 ++	  #define __OSX_AVAILABLE_BUT_DEPRECATED_MSG(_osxIntro, _osxDep, _iosIntro, _iosDep, _msg)
 ++	#endif
 ++	_EOFix_;
 ++
 ++    test_text = "#endif /* __OSX_AVAILABLE_STARTING */";
 ++};
 ++
 ++/*
 +  *  For the AAB_darwin7_9_long_double_funcs fix to be useful,
 +  *  you have to not use "" includes.
 +  */



 ----- End forwarded message -----

From: Andreas Gustafsson <gson@gson.org>
To: maya@NetBSD.org, Min Sik Kim <minskim@netbsd.org>
Cc: gnats-bugs@netbsd.org,
    macos-pkg-people@netbsd.org
Subject: Re: pkg/53691: lang/gcc48 won't build on macOS 10.14
Date: Sun, 20 Oct 2019 12:48:44 +0300

 maya@NetBSD.org wrote:
 >  Might be worth a shot
 [...]
 >  https://github.com/Homebrew/homebrew-core/pull/44762
 [...]
 >  cvs rdiff -u -r1.10 -r1.11 pkgsrc/lang/gcc8/distinfo
 >  cvs rdiff -u -r0 -r1.1 pkgsrc/lang/gcc8/patches/patch-fixincludes_fixincl.x \
 >      pkgsrc/lang/gcc8/patches/patch-fixincludes_inclhack.def

 I'm confused by this on multiple levels.

 1. I don't think that commit is relevant to pkg/53691; it looks like it
 is trying to fix a completely different error.

 2. That commit has a commit message of "lang/gcc8: Make this build on
 macOS Catalina", implying that it is fixing the build of gcc itself,
 but the pull request on homebrew appears to say that it fixes issues
 building software *with* gcc, not building gcc itself.

 3. lang/gcc8 does not build for me on macOS Catalina (10.15) before
 nor after that commit.  The error is the same as before:

   lipo -output libgcc_ext.10.5.dylib -create libgcc_ext.10.5.dylib_T*
   lipo -output libgcc_ext.10.4.dylib -create libgcc_ext.10.4.dylib_T*
   fatal error: /Applications/XCode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't open input file: libgcc_ext.10.4.dylib_T* (No such file or directory)
   fatal error: /Applications/XCode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't open input file: libgcc_ext.10.5.dylib_T* (No such file or directory)

 -- 
 Andreas Gustafsson, gson@gson.org

From: Andreas Gustafsson <gson@gson.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/53691: lang/gcc48 won't build on macOS 10.14
Date: Fri, 8 Nov 2019 16:22:42 +0200

 I have now figured out what's going wrong, and found a work-around,
 but not a proper fix.

 I had an unconditional INSTALL_UNSTRIPPED=yes in mk.conf to facilitate
 debugging of the installed packages.  The gcc48 package build attempts
 to invoke the macOS strip(1) with an "-o" option to direct the
 stripped output to a new file rather than overwriting the original,
 with a command like

   /path/to/pkgsrc/lang/gcc48/work/.tools/bin/strip -o libgcc_ext.10.4.dylib_T. -R ../../../gcc-4.8.5/libgcc/config/i386/libgcc-darwin.10.4.ver -c -urx .././libgcc/./libgcc_s.dylib

 but INSTALL_UNSTRIPPED=yes turns .tools/bin/strip into a no-op, so the
 output file given with "-o" is never written to.  This then causes
 "lipo" to fail because its input file is missing.

 By commenting out the INSTALL_UNSTRIPPED=yes in mk.conf, I can
 successfully build gcc8 on macOS 10.15.  Building gcc48 still fails,
 but with a different error that should get its own PR.

 Any ideas how the INSTALL_UNSTRIPPED=yes case could be made to work?
 -- 
 Andreas Gustafsson, gson@gson.org

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.