Quantcast

[MacPorts] #53726: libgcc / gcc fails to build against SDK (i.e. without system headers installed)

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[MacPorts] #53726: libgcc / gcc fails to build against SDK (i.e. without system headers installed)

MacPorts
#53726: libgcc / gcc fails to build against SDK (i.e. without system headers
installed)
----------------------+----------------------
 Reporter:  jeremyhu  |      Owner:  jeremyhu
     Type:  defect    |     Status:  new
 Priority:  Normal    |  Milestone:
Component:  ports     |    Version:
 Keywords:            |       Port:  libgcc
----------------------+----------------------
 libgcc (and gccXY) fail to build on systems that do not contain system
 headers (i.e., installs configured to use a real SDK rather than the
 DevSDK from CLTools).

 The tail of the failure is:

 {{{
 /bin/sh /opt/local/var/macports/build/_Users_jeremy_src_macports_macports-
 ports_lang_gcc6/libgcc/work/gcc-6.3.0/gcc/../move-if-change tmp-macro_list
 macro_list
 echo timestamp > s-macro_list
 rm -rf include-fixed; mkdir include-fixed
 chmod a+rx include-fixed
 if [ -d ../prev-gcc ]; then \
           cd ../prev-gcc && \
           /Applications/Xcode.app/Contents/Developer/usr/bin/make real-
 install-headers-tar DESTDIR=`pwd`/../gcc/ \
             libsubdir=. ; \
         else \
           set -e; for ml in `cat fixinc_list`; do \
             sysroot_headers_suffix=`echo ${ml} | sed -e 's/;.*$//'`; \
             multi_dir=`echo ${ml} | sed -e 's/^[^;]*;//'`; \
             fix_dir=include-fixed${multi_dir}; \
             if ! false && test ! -d `echo /usr/include | sed -e :a -e
 's,[^/]*/\.\.\/,,' -e ta`; then \
               echo The directory that should contain system headers does
 not exist: >&2 ; \
               echo "  `echo /usr/include | sed -e :a -e 's,[^/]*/\.\.\/,,'
 -e ta`" >&2 ; \
               tooldir_sysinc=`echo "/opt/local/lib/libgcc/gcc/x86_64
 -apple-darwin17/6.3.0/../../../../../x86_64-apple-darwin17/sys-include" |
 sed -e :a -e "s,[^/]*/\.\.\/,," -e ta`; \
               if test "x`echo /usr/include | sed -e :a -e
 's,[^/]*/\.\.\/,,' -e ta`" = "x${tooldir_sysinc}"; \
               then sleep 1; else exit 1; fi; \
             fi; \
             /bin/sh /opt/local/var/macports/build
 /_Users_jeremy_src_macports_macports-
 ports_lang_gcc6/libgcc/work/gcc-6.3.0/gcc/../mkinstalldirs ${fix_dir}; \
             chmod a+rx ${fix_dir} || true; \
             (TARGET_MACHINE='x86_64-apple-darwin17'; srcdir=`cd
 /opt/local/var/macports/build/_Users_jeremy_src_macports_macports-
 ports_lang_gcc6/libgcc/work/gcc-6.3.0/gcc; ${PWDCMD-pwd}`; \
               SHELL='/bin/sh'; MACRO_LIST=`${PWDCMD-pwd}`/macro_list ; \
               gcc_dir=`${PWDCMD-pwd}` ; \
               export TARGET_MACHINE srcdir SHELL MACRO_LIST && \
               cd ../build-x86_64-apple-darwin17/fixincludes && \
               /bin/sh ./fixinc.sh "${gcc_dir}/${fix_dir}" \
                 `echo /usr/include | sed -e :a -e 's,[^/]*/\.\.\/,,' -e
 ta`  ); \
             rm -f ${fix_dir}/syslimits.h; \
             if [ -f ${fix_dir}/limits.h ]; then \
               mv ${fix_dir}/limits.h ${fix_dir}/syslimits.h; \
             else \
               cp /opt/local/var/macports/build
 /_Users_jeremy_src_macports_macports-
 ports_lang_gcc6/libgcc/work/gcc-6.3.0/gcc/gsyslimits.h
 ${fix_dir}/syslimits.h; \
             fi; \
             chmod a+r ${fix_dir}/syslimits.h; \
           done; \
         fi
 The directory that should contain system headers does not exist:
   /usr/include
 make[3]: *** [stmp-fixinc] Error 1
 rm gcc.pod
 make[3]: Leaving directory `/opt/local/var/macports/build
 /_Users_jeremy_src_macports_macports-
 ports_lang_gcc6/libgcc/work/build/gcc'
 make[2]: *** [all-stage1-gcc] Error 2
 make[2]: Leaving directory `/opt/local/var/macports/build
 /_Users_jeremy_src_macports_macports-ports_lang_gcc6/libgcc/work/build'
 make[1]: *** [stage1-bubble] Error 2
 make[1]: Leaving directory `/opt/local/var/macports/build
 /_Users_jeremy_src_macports_macports-ports_lang_gcc6/libgcc/work/build'
 make: *** [bootstrap-lean] Error 2
 make: Leaving directory `/opt/local/var/macports/build
 /_Users_jeremy_src_macports_macports-ports_lang_gcc6/libgcc/work/build'
 Command failed:  cd "/opt/local/var/macports/build
 /_Users_jeremy_src_macports_macports-ports_lang_gcc6/libgcc/work/build" &&
 /usr/bin/make -j8 -w bootstrap-lean
 Exit code: 2
 }}}

--
Ticket URL: <https://trac.macports.org/ticket/53726>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [MacPorts] #53726: libgcc / gcc fails to build against SDK (i.e. without system headers installed)

MacPorts
#53726: libgcc / gcc fails to build against SDK (i.e. without system headers
installed)
-----------------------+----------------------
  Reporter:  jeremyhu  |      Owner:  jeremyhu
      Type:  defect    |     Status:  new
  Priority:  Normal    |  Milestone:
 Component:  ports     |    Version:
Resolution:            |   Keywords:
      Port:  libgcc    |
-----------------------+----------------------

Comment (by jeremyhu):

 I'll do my best to try and figure this out, but it's likely to not get
 fixed unless someone who is able to read GPLv3 code can fix the broken
 build.

--
Ticket URL: <https://trac.macports.org/ticket/53726#comment:1>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [MacPorts] #53726: libgcc / gcc fails to build against SDK (i.e. without system headers installed)

MacPorts
In reply to this post by MacPorts
#53726: libgcc / gcc fails to build against SDK (i.e. without system headers
installed)
-----------------------+----------------------
  Reporter:  jeremyhu  |      Owner:  jeremyhu
      Type:  defect    |     Status:  new
  Priority:  Normal    |  Milestone:
 Component:  ports     |    Version:
Resolution:            |   Keywords:
      Port:  libgcc    |
-----------------------+----------------------

Comment (by jeremyhu):

 I suspected that this should work if I pass --with-build-sysroot=... to
 configure, but I still hit the same issue.  I think that's likely an issue
 that upstream needs to fix, since it should be looking in the sysroot for
 /usr/include.

 See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79885

 Looking at gcc-4.2, I think this should work if I add
 SYSTEM_HEADER_DIR="${configure.sdkroot}/usr/include" to build.args, so
 giving that a try next...

--
Ticket URL: <https://trac.macports.org/ticket/53726#comment:2>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [MacPorts] #53726: libgcc / gcc fails to build against SDK (i.e. without system headers installed)

MacPorts
In reply to this post by MacPorts
#53726: libgcc / gcc fails to build against SDK (i.e. without system headers
installed)
-----------------------+----------------------
  Reporter:  jeremyhu  |      Owner:  jeremyhu
      Type:  defect    |     Status:  new
  Priority:  Normal    |  Milestone:
 Component:  ports     |    Version:
Resolution:            |   Keywords:
      Port:  libgcc    |
-----------------------+----------------------

Comment (by jeremyhu):

 In [changeset:"cf63124116c323a1c00be134e955bb9d9b67c788/macports-ports"
 cf631241/macports-ports]:
 {{{
 #!ConfigurableCommitTicketReference repository="macports-ports"
 revision="cf63124116c323a1c00be134e955bb9d9b67c788"
 gcc*: Fix building against an SDK

 With this change, gcc now builds when configure.sdkroot is an SDK.  The
 intention is that the installed gcc should be identical to a build in
 which
 configure.sdkroot is /, but GCC's build system is flawed and does not
 properly implement their --with-build-sdkroot= configure option.

 As a workaround, we are using --with-sdkroot= which causes the installed
 gcc
 to look in the SDKROOT by default instead of / by default.  Hopefully GCC
 will provide a fix for this bug, or someone who is able to look at GPLv3
 code
 can provide a fix for them.  In the mean time, this is better than failing
 to build.

 See https://trac.macports.org/ticket/53726
 See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79885

 Signed-off-by: Jeremy Huddleston Sequoia <[hidden email]>
 }}}

--
Ticket URL: <https://trac.macports.org/ticket/53726#comment:3>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [MacPorts] #53726: libgcc / gcc fails to build against SDK (i.e. without system headers installed)

MacPorts
In reply to this post by MacPorts
#53726: libgcc / gcc fails to build against SDK (i.e. without system headers
installed)
-----------------------+----------------------
  Reporter:  jeremyhu  |      Owner:  jeremyhu
      Type:  defect    |     Status:  new
  Priority:  Normal    |  Milestone:
 Component:  ports     |    Version:
Resolution:            |   Keywords:
      Port:  libgcc    |
-----------------------+----------------------

Comment (by kencu):

 Something about this change appears to have broken the build of gcc48
 (presently I'm doing this on 10.6 with Libcxx), working on fixing the
 gcc48 build with the new texinfo and new isl. With this change, this error
 comes up:
 {{{

 rm -f libgcov.a
 objects="_gcov.o _gcov_merge_add.o _gcov_merge_single.o
 _gcov_merge_delta.o _gcov_fork.o _gcov_execl.o _gcov_execlp.o
 _gcov_execle.o _gcov_execv.o _gcov_execvp.o _gcov_execve.o _gcov_reset.o
 _gcov_dump.o _gcov_interval_profiler.o _gcov_pow2_profiler.o
 _gcov_one_value_profiler.o _gcov_indirect_call_profiler.o
 _gcov_average_profiler.o _gcov_ior_profiler.o _gcov_merge_ior.o";
 \
         if test -z "$objects"; then                             \
           echo 'int __libgcc_eh_dummy;' > eh_dummy.c;           \
           /opt/local/var/macports/build/_opt_macports-
 ports_lang_gcc48/gcc48/work/build/./gcc/xgcc
 -B/opt/local/var/macports/build/_opt_macports-
 ports_lang_gcc48/gcc48/work/build/./gcc/ -B/opt/local/x86_64-apple-
 darwin10/bin/ -B/opt/local/x86_64-apple-darwin10/lib/ -isystem
 /opt/local/x86_64-apple-darwin10/include -isystem /opt/local/x86_64-apple-
 darwin10/sys-include    -g -O2 -pipe -Os -O2  -g -O2 -pipe -Os -DIN_GCC
 -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes
 -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -pipe
 -fno-common -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector   -pipe
 -fno-common -I. -I. -I../.././gcc -I/opt/local/var/macports/build
 /_opt_macports-ports_lang_gcc48/gcc48/work/gcc-4.8.5/libgcc
 -I/opt/local/var/macports/build/_opt_macports-
 ports_lang_gcc48/gcc48/work/gcc-4.8.5/libgcc/.
 -I/opt/local/var/macports/build/_opt_macports-
 ports_lang_gcc48/gcc48/work/gcc-4.8.5/libgcc/../gcc
 -I/opt/local/var/macports/build/_opt_macports-
 ports_lang_gcc48/gcc48/work/gcc-4.8.5/libgcc/../include  -DHAVE_CC_TLS
 -DUSE_EMUTLS -fvisibility=hidden -DHIDE_EXPORTS -c eh_dummy.c
 \
              -o eh_dummy.o;                             \
           objects=eh_dummy.o;                           \
         fi;                                                     \
         /opt/local/bin/ar  rc libgcov.a $objects
 ld: file not found: non-weak
 collect2: error: ld returned 1 exit status
 make[3]: *** [libgcc_s.dylib] Error 1
 }}}
 removing this change, this error disappears and the build proceeds:
 {{{

 rm -f libgcov.a
 objects="_gcov.o _gcov_merge_add.o _gcov_merge_single.o
 _gcov_merge_delta.o _gcov_fork.o _gcov_execl.o _gcov_execlp.o
 _gcov_execle.o _gcov_execv.o _gcov_execvp.o _gcov_execve.o _gcov_reset.o
 _gcov_dump.o _gcov_interval_profiler.o _gcov_pow2_profiler.o
 _gcov_one_value_profiler.o _gcov_indirect_call_profiler.o
 _gcov_average_profiler.o _gcov_ior_profiler.o _gcov_merge_ior.o";
 \
         if test -z "$objects"; then                             \
           echo 'int __libgcc_eh_dummy;' > eh_dummy.c;           \
           /opt/local/var/macports/build/_opt_macports-
 ports_lang_gcc48/gcc48/work/build/./gcc/xgcc
 -B/opt/local/var/macports/build/_opt_macports-
 ports_lang_gcc48/gcc48/work/build/./gcc/ -B/opt/local/x86_64-apple-
 darwin10/bin/ -B/opt/local/x86_64-apple-darwin10/lib/ -isystem
 /opt/local/x86_64-apple-darwin10/include -isystem /opt/local/x86_64-apple-
 darwin10/sys-include    -g -O2 -pipe -Os -O2  -g -O2 -pipe -Os -DIN_GCC
 -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes
 -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -pipe
 -fno-common -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector   -pipe
 -fno-common -I. -I. -I../.././gcc -I/opt/local/var/macports/build
 /_opt_macports-ports_lang_gcc48/gcc48/work/gcc-4.8.5/libgcc
 -I/opt/local/var/macports/build/_opt_macports-
 ports_lang_gcc48/gcc48/work/gcc-4.8.5/libgcc/.
 -I/opt/local/var/macports/build/_opt_macports-
 ports_lang_gcc48/gcc48/work/gcc-4.8.5/libgcc/../gcc
 -I/opt/local/var/macports/build/_opt_macports-
 ports_lang_gcc48/gcc48/work/gcc-4.8.5/libgcc/../include  -DHAVE_CC_TLS
 -DUSE_EMUTLS -fvisibility=hidden -DHIDE_EXPORTS -c eh_dummy.c
 \
              -o eh_dummy.o;                             \
           objects=eh_dummy.o;                           \
         fi;                                                     \
         /opt/local/bin/ar  rc libgcov.a $objects
 /opt/local/bin/ranlib libgcov.a
 }}}

 with so many changes coming in to affect the build of gcc48 without
 previous errors being fixed, it is getting a little tricky.

--
Ticket URL: <https://trac.macports.org/ticket/53726#comment:4>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [MacPorts] #53726: libgcc / gcc fails to build against SDK (i.e. without system headers installed)

MacPorts
In reply to this post by MacPorts
#53726: libgcc / gcc fails to build against SDK (i.e. without system headers
installed)
-----------------------+----------------------
  Reporter:  jeremyhu  |      Owner:  jeremyhu
      Type:  defect    |     Status:  new
  Priority:  Normal    |  Milestone:
 Component:  ports     |    Version:
Resolution:            |   Keywords:
      Port:  libgcc    |
-----------------------+----------------------

Comment (by jeremyhu):

 This only changes the build `if {${configure.sdkroot} ne "/"}` ... Are you
 actually building against an SDK and it was working before?

 What is ${configure.sdkroot} evaluating to for you?  I wonder if I misread
 things and it's an empty string in some cases.

--
Ticket URL: <https://trac.macports.org/ticket/53726#comment:5>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [MacPorts] #53726: libgcc / gcc fails to build against SDK (i.e. without system headers installed)

MacPorts
In reply to this post by MacPorts
#53726: libgcc / gcc fails to build against SDK (i.e. without system headers
installed)
-----------------------+----------------------
  Reporter:  jeremyhu  |      Owner:  jeremyhu
      Type:  defect    |     Status:  new
  Priority:  Normal    |  Milestone:
 Component:  ports     |    Version:
Resolution:            |   Keywords:
      Port:  libgcc    |
-----------------------+----------------------

Comment (by kencu):

 I think that's it exactly  -- in my case, at least on this 10.6.8 machine
 I'm on right now, ${configure.sdkroot} evaluates to an empty string.

--
Ticket URL: <https://trac.macports.org/ticket/53726#comment:6>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [MacPorts] #53726: libgcc / gcc fails to build against SDK (i.e. without system headers installed)

MacPorts
In reply to this post by MacPorts
#53726: libgcc / gcc fails to build against SDK (i.e. without system headers
installed)
-----------------------+----------------------
  Reporter:  jeremyhu  |      Owner:  jeremyhu
      Type:  defect    |     Status:  new
  Priority:  Normal    |  Milestone:
 Component:  ports     |    Version:
Resolution:            |   Keywords:
      Port:  libgcc    |
-----------------------+----------------------

Comment (by jeremyhu):

 Thanks, Ken.  Sorry about that.

--
Ticket URL: <https://trac.macports.org/ticket/53726#comment:7>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [MacPorts] #53726: libgcc / gcc fails to build against SDK (i.e. without system headers installed)

MacPorts
In reply to this post by MacPorts
#53726: libgcc / gcc fails to build against SDK (i.e. without system headers
installed)
-----------------------+----------------------
  Reporter:  jeremyhu  |      Owner:  jeremyhu
      Type:  defect    |     Status:  new
  Priority:  Normal    |  Milestone:
 Component:  ports     |    Version:
Resolution:            |   Keywords:
      Port:  libgcc    |
-----------------------+----------------------

Comment (by jeremyhu):

 In [changeset:"9d47963e77f12382350c5dbeca25a3a497b78065/macports-ports"
 9d47963e/macports-ports]:
 {{{
 #!ConfigurableCommitTicketReference repository="macports-ports"
 revision="9d47963e77f12382350c5dbeca25a3a497b78065"
 gcc*: Fix test for unset SDKROOT

 See https://trac.macports.org/ticket/53726

 Signed-off-by: Jeremy Huddleston Sequoia <[hidden email]>
 }}}

--
Ticket URL: <https://trac.macports.org/ticket/53726#comment:8>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [MacPorts] #53726: libgcc / gcc fails to build against SDK (i.e. without system headers installed)

MacPorts
In reply to this post by MacPorts
#53726: libgcc / gcc fails to build against SDK (i.e. without system headers
installed)
-----------------------+----------------------
  Reporter:  jeremyhu  |      Owner:  jeremyhu
      Type:  defect    |     Status:  new
  Priority:  Normal    |  Milestone:
 Component:  ports     |    Version:
Resolution:            |   Keywords:
      Port:  libgcc    |
-----------------------+----------------------

Comment (by jeremyhu):

 In [changeset:"9d47963e77f12382350c5dbeca25a3a497b78065/macports-ports"
 9d47963e/macports-ports]:
 {{{
 #!ConfigurableCommitTicketReference repository="macports-ports"
 revision="9d47963e77f12382350c5dbeca25a3a497b78065"
 gcc*: Fix test for unset SDKROOT

 See https://trac.macports.org/ticket/53726

 Signed-off-by: Jeremy Huddleston Sequoia <[hidden email]>
 }}}

--
Ticket URL: <https://trac.macports.org/ticket/53726#comment:9>
MacPorts <https://www.macports.org/>
Ports system for macOS
Loading...