Failure During Building

2023-02-17 Thread -xlan- via Gcc
I was building gcc version 4.9.1 on Mac OS version when I got this error:

In file included from ../../gcc-4.9.1/gcc/c/c-objc-common.c:33:
In file included from
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/new:93:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:184:5:
error: no member named 'fancy_abort' in namespace 'std::__1'; did you mean
simply 'fancy_abort'?
_VSTD::abort();
^~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:858:15:
note: expanded from macro '_VSTD'
#define _VSTD std::_LIBCPP_ABI_NAMESPACE
  ^
../../gcc-4.9.1/gcc/system.h:685:13: note: 'fancy_abort' declared here
extern void fancy_abort (const char *, int, const char *)
ATTRIBUTE_NORETURN;
^
1 error generated.
make[1]: *** [c/c-objc-common.o] Error 1
make: *** [all-gcc] Error 2

Mac OS: Monterey 12.6.4


Re: Failure During Building

2023-02-18 Thread -xlan- via Gcc
I tried compiling version 12.2.0 and it attempts to access system headers
at /usr/include, but on mac the system headers are stored at

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include.

Here's my error:
rm -rf include-fixed; mkdir include-fixed
chmod a+rx include-fixed
if [ -d ../prev-gcc ]; then \
  cd ../prev-gcc && \
  /Library/Developer/CommandLineTools/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
"/lib/gcc/x86_64-apple-darwin21.6.0/12.2.0/../../../../x86_64-apple-darwin21.6.0/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 ../../gcc-12.2.0/gcc/../mkinstalldirs ${fix_dir}; \
chmod a+rx ${fix_dir} || true; \
(TARGET_MACHINE='x86_64-apple-darwin21.6.0'; srcdir=`cd
../../gcc-12.2.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-darwin21.6.0/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 ../../gcc-12.2.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[1]: *** [stmp-fixinc] Error 1
make: *** [all-gcc] Error 2


On Fri, Feb 17, 2023 at 8:04 AM Iain Sandoe  wrote:

>
>
> > On 17 Feb 2023, at 15:37, Jonathan Wakely via Gcc 
> wrote:
> >
> > On Fri, 17 Feb 2023, 15:17 -xlan- via Gcc,  wrote:
> >
> >> I was building gcc version 4.9.1
> >
> >
> > Why?
>
> Indeed, what is the use-case?
> trying to build such an old GCC version on modern macOS could be
> problematic.
>
> > on Mac OS version when I got this error:
> >>
> >> In file included from ../../gcc-4.9.1/gcc/c/c-objc-common.c:33:
> >> In file included from
> >>
> >>
> /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/new:93:
> >>
> >>
> /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:184:5:
> >> error: no member named 'fancy_abort' in namespace 'std::__1'; did you
> mean
> >> simply 'fancy_abort'?
> >>_VSTD::abort();
> >>^~~
> >>
> >
> >
> > The GCC sources define 'abort' as a macro, which appears to be
> incompatible
> > with LLVM's libc++.
> >
> > You might be able to compile using -stdlib=libstdc++ instead.
>
> There are no headers for libstdc++ in SDKs for OSX 10.13 + (so you would
> need also to find an
> older SDK and then build with an OSX target of say 10.12).
>
> What you are trying to do is going to required quite advanced techniques
> to deal with the difference in the OS, compiler and bootstrap tools.  I
> have not attempted anything < GCC-5 on newer machines.
>
> Iain
>
>
>
>


Re: Failure During Building

2023-02-20 Thread -xlan- via Gcc
Hi, I have the SDK installed but I don't understand how to use the
--with-sysroot command. Is the flag supposed to be with my make all-gcc
command, please elaborate.
On Sat, Feb 18, 2023 at 3:49 PM Iain Sandoe  wrote:

> Hi
>
> > On 18 Feb 2023, at 20:28, -xlan-  wrote:
> >
> > I tried compiling version 12.2.0 and it attempts to access system
> headers at /usr/include, but on mac the system headers are stored at
> >
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include.
>
> For supported x86_64 GCC versions (at present 12 and trunk) on macOS12.
>
> It is usually easiest to install the Xcode Command Line Tools - the SDK
> path is then /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk
>
> then add the following to your configure line:
>
> —with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk
>
> If you want to use the set in Xcode then add the following to your
> configure line:
>
> —with-sysroot=`xcrun --show-sdk-path`
>
> I prefer/recommend the first option.
> HTH,
> Iain
>
>
>


Re: Failure During Building

2023-02-20 Thread -xlan- via Gcc
Thanks, I'll check it out.

On Sun, Feb 19, 2023 at 8:48 AM Iain Sandoe  wrote:

>
>
> > On 19 Feb 2023, at 16:27, -xlan-  wrote:
> >
> > Hi, I have the SDK installed but I don't understand how to use the
> --with-sysroot command. Is the flag supposed to be with my make all-gcc
> command, please elaborate.
>
> It is a configure argument for GCC’s configure script - there is more
> information here:
> https://gcc.gnu.org/install/  (and in the linked pages)
>
>  I guess (in your build script) you have something like
>
> …/configure —prefix=….
>
> the --with-sysroot=…. need to be appended to that.
>
> Iain
>
>