comp.lang.ada
 help / color / mirror / Atom feed
* Problem building GNAT CE 2021 on Mac Catalina
@ 2021-06-17 11:34 Roger Mc
  2021-06-17 16:49 ` Simon Wright
  0 siblings, 1 reply; 8+ messages in thread
From: Roger Mc @ 2021-06-17 11:34 UTC (permalink / raw)


Mac OSX 10.15.7 
XCode 12.0

I am attemting to build  using the insttructions provided by the README.BUILD from the source distribution of GNAT.

I configure successfully from my /opt/GNAT/2021/obj directory with

../src/configure --enable-languages="c,ada" --disable-libada --with-gmp=/usr/local/Cellar/gmp/6.2.1 --with-mpfr=/usr/local/Cellar/mpfr/4.1.0 --with-mpc=/usr/local/Cellar/libmpc/1.1.0

Although My /usr/local/include directory does include  libintl.h
 make bootstrap fails with:
In file included from ../../src/libcpp/charset.c:21:
../../src/libcpp/system.h:279:10: fatal error: libintl.h: No such file or directory
 #include <libintl.h>

Assistance with solving this problem will be greatly appreciated.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Problem building GNAT CE 2021 on Mac Catalina
  2021-06-17 11:34 Problem building GNAT CE 2021 on Mac Catalina Roger Mc
@ 2021-06-17 16:49 ` Simon Wright
  2021-06-18  8:01   ` Roger Mc
  0 siblings, 1 reply; 8+ messages in thread
From: Simon Wright @ 2021-06-17 16:49 UTC (permalink / raw)


Roger Mc <rogermcm2@gmail.com> writes:

> Mac OSX 10.15.7 
> XCode 12.0
>
> I am attemting to build using the insttructions provided by the
> README.BUILD from the source distribution of GNAT.
>
> I configure successfully from my /opt/GNAT/2021/obj directory with
>
> ../src/configure --enable-languages="c,ada" --disable-libada
> --with-gmp=/usr/local/Cellar/gmp/6.2.1
> --with-mpfr=/usr/local/Cellar/mpfr/4.1.0
> --with-mpc=/usr/local/Cellar/libmpc/1.1.0
>
> Although My /usr/local/include directory does include  libintl.h
>  make bootstrap fails with:
> In file included from ../../src/libcpp/charset.c:21:
> ../../src/libcpp/system.h:279:10: fatal error: libintl.h: No such file
> or directory
>  #include <libintl.h>

I think those instructions are rather old. Two things:

* usually, GCC build instructions say not to make the build directory a
  subdirectory of the source
* nowadays you don't need to --disable-libada and then "make -C gcc
  gnatlib gnattools"

What compiler are you starting from?

What stage of the build did this fail at? (stage_current in the build
directory)

It looks as though this is to do with "Native Language Support (NLS),
which lets GCC output diagnostics in languages other than American
English". The configuration documentation at
https://gcc.gnu.org/install/configure.html suggests --disable-nls (which
is what I do) or --with-included-gettext.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Problem building GNAT CE 2021 on Mac Catalina
  2021-06-17 16:49 ` Simon Wright
@ 2021-06-18  8:01   ` Roger Mc
  2021-06-18 12:18     ` Roger Mc
  0 siblings, 1 reply; 8+ messages in thread
From: Roger Mc @ 2021-06-18  8:01 UTC (permalink / raw)


On Friday, June 18, 2021 at 2:49:28 AM UTC+10, Simon Wright wrote:
> Roger Mc <roge...@gmail.com> writes: 
> 
> > Mac OSX 10.15.7 
> > XCode 12.0 
> > 
> > I am attemting to build using the insttructions provided by the 
> > README.BUILD from the source distribution of GNAT. 
> > 
> > I configure successfully from my /opt/GNAT/2021/obj directory with 
> > 
> > ../src/configure --enable-languages="c,ada" --disable-libada 
> > --with-gmp=/usr/local/Cellar/gmp/6.2.1 
> > --with-mpfr=/usr/local/Cellar/mpfr/4.1.0 
> > --with-mpc=/usr/local/Cellar/libmpc/1.1.0 
> > 
> > Although My /usr/local/include directory does include libintl.h 
> > make bootstrap fails with: 
> > In file included from ../../src/libcpp/charset.c:21: 
> > ../../src/libcpp/system.h:279:10: fatal error: libintl.h: No such file 
> > or directory 
> > #include <libintl.h>
> I think those instructions are rather old. Two things: 
> 
> * usually, GCC build instructions say not to make the build directory a 
> subdirectory of the source 
My build directory is not a subdirectory of the source 
> * nowadays you don't need to --disable-libada and then "make -C gcc 
> gnatlib gnattools" 
> 
> What compiler are you starting from? 
GNAT 2020
> 
> What stage of the build did this fail at? (stage_current in the build 
> directory) 
I think stage 3
> 
> It looks as though this is to do with "Native Language Support (NLS), 
> which lets GCC output diagnostics in languages other than American 
> English". The configuration documentation at 
> https://gcc.gnu.org/install/configure.html suggests --disable-nls (which 
> is what I do) or --with-included-gettext.

Thanks for the advice which has been quite helpful.
I have progressed but still, after quit a long time the build fails.
My current method:
In src/gcc/Makefile.in change the  path to the system headers on the build machine to:
BUILD_SYSTEM_HEADER_DIR = /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include

Follow instructions in gnat-2021-20210519-19A70-src/src

 ../src/configure --enable-languages="c,ada" --with-gmp=/usr/local/Cellar/gmp/6.2.1 --with-mpfr=/usr/local/Cellar/mpfr/4.1.0 --with-mpc=/usr/local/Cellar/libmpc/1.1.0 --disable-nls --disable-libstdcxx

make boostrap

results in:
raise-gcc.c:718:18: warning: 'cleanup_filter' defined but not used [-Wunused-const-variable=]
  718 | static const int cleanup_filter = 0;
      |                  ^~~~~~~~~~~~~~
raise-gcc.c:627:1: warning: 'get_ttype_entry_for' defined but not used [-Wunused-function]
  627 | get_ttype_entry_for (region_descriptor *region, long filter)
      | ^~~~~~~~~~~~~~~~~~~
make[6]: *** [raise-gcc.o] Error 1
make[5]: *** [gnatlib] Error 2
make[4]: *** [gnatlib-shared-darwin] Error 2
make[3]: *** [gnatlib-shared] Error 2
make[2]: *** [gnatlib-shared] Error 2
make[1]: *** [all-target-libada] Error 2
make: *** [bootstrap] Error 2

This occurs a long way after:
Comparing stages 2 and 3
Comparison successful.
.....
Configuring in ./fixincludes
.....
Configuring in ./gnattools
.....
Configuring in x86_64-apple-darwin19.6.0/libada
....

This seems to be the relevant command and first error message preceding many other warning and error messages before final failure:
/opt/GNAT/2021/obj/./gcc/xgcc -B/opt/GNAT/2021/obj/./gcc/ -B/usr/local/x86_64-apple-darwin19.6.0/bin/ -B/usr/local/x86_64-apple-darwin19.6.0/lib/ -isystem /usr/local/x86_64-apple-darwin19.6.0/include -isystem /usr/local/x86_64-apple-darwin19.6.0/sys-include   -fchecking=1 -c -DIN_GCC  -W -Wall -g -O2 -g -O2 -fexceptions -DIN_RTS -DHAVE_GETIPINFO   -fno-common -fno-common   \
	      -iquote . -iquote .. -iquote ../.. -iquote /opt/GNAT/2021/src/gcc/ada -iquote /opt/GNAT/2021/src/gcc -I/opt/GNAT/2021/src/include  -I./../.. -fno-omit-frame-pointer tracebak.c -o tracebak.o

In file included from tracebak.c:603:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/unwind.h:208:48: warning: 'unavailable' attribute directive ignored [-Wattributes]
  208 | extern uintptr_t _Unwind_GetDataRelBase(struct _Unwind_Context* context) __attribute__((unavailable));

This failure is way beyond my understanding of the build process.
Thanks.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Problem building GNAT CE 2021 on Mac Catalina
  2021-06-18  8:01   ` Roger Mc
@ 2021-06-18 12:18     ` Roger Mc
  2021-06-19  7:29       ` Roger Mc
  2021-06-20 10:20       ` Roger Mc
  0 siblings, 2 replies; 8+ messages in thread
From: Roger Mc @ 2021-06-18 12:18 UTC (permalink / raw)


Compiler version:
GNAT Community 2020 (20200429-84)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Problem building GNAT CE 2021 on Mac Catalina
  2021-06-18 12:18     ` Roger Mc
@ 2021-06-19  7:29       ` Roger Mc
  2021-06-20 10:20       ` Roger Mc
  1 sibling, 0 replies; 8+ messages in thread
From: Roger Mc @ 2021-06-19  7:29 UTC (permalink / raw)


I don't know what happened but the problem has changed even when rebuilding from scratch (original tar balls).

In src/gcc/Makefile.in change "path to the system headers on the build machine" to:
BUILD_SYSTEM_HEADER_DIR = /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include
then, from build directory:

../src/configure --enable-languages="c,ada" --with-gmp=/usr/local/Cellar/gmp/6.2.1 --with-mpfr=/usr/local/Cellar/mpfr/4.1.0 --with-mpc=/usr/local/Cellar/libmpc/1.1.0 --disable-nls
followed by make bootstrap produces:

checking whether /opt/GNAT/2021/obj/./gcc/xgcc -B/opt/GNAT/2021/obj/./gcc/ -B/usr/local/x86_64-apple-darwin19.6.0/bin/ -B/usr/local/x86_64-apple-darwin19.6.0/lib/ -isystem /usr/local/x86_64-apple-darwin19.6.0/include -isystem /usr/local/x86_64-apple-darwin19.6.0/sys-include   -fno-checking accepts -g... yes
checking for /opt/GNAT/2021/obj/./gcc/xgcc -B/opt/GNAT/2021/obj/./gcc/ -B/usr/local/x86_64-apple-darwin19.6.0/bin/ -B/usr/local/x86_64-apple-darwin19.6.0/lib/ -isystem /usr/local/x86_64-apple-darwin19.6.0/include -isystem /usr/local/x86_64-apple-darwin19.6.0/sys-include   -fno-checking option to accept ISO C89... unsupported
checking how to run the C preprocessor... /lib/cpp
configure: error: in `/opt/GNAT/2021/obj/x86_64-apple-darwin19.6.0/libgcc':
configure: error: C preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details
make[2]: *** [configure-stage1-target-libgcc] Error 1
make[1]: *** [stage1-bubble] Error 2
make: *** [bootstrap] Error 2

Relevant part of    obj/x86_64-apple-darwin19.6.0/libgcc/config.log:
configure:4140: /lib/cpp  conftest.c
/opt/GNAT/2021/src/libgcc/configure: line 1528: /lib/cpp: No such file or directory
configure:4140: $? = 127
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU C Runtime Library"
| #define PACKAGE_TARNAME "libgcc"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "GNU C Runtime Library 1.0"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL "http://www.gnu.org/software/libgcc/"
| /* end confdefs.h.  */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
| 		     Syntax error
configure:4170: error: in `/opt/GNAT/2021/obj/x86_64-apple-darwin19.6.0/libgcc':
configure:4172: error: C preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details

Thanks for ongoing advice.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Problem building GNAT CE 2021 on Mac Catalina
  2021-06-18 12:18     ` Roger Mc
  2021-06-19  7:29       ` Roger Mc
@ 2021-06-20 10:20       ` Roger Mc
  2021-06-20 11:21         ` Simon Wright
  1 sibling, 1 reply; 8+ messages in thread
From: Roger Mc @ 2021-06-20 10:20 UTC (permalink / raw)


On Friday, June 18, 2021 at 10:18:48 PM UTC+10, Roger Mc wrote:
> Compiler version: 
> GNAT Community 2020 (20200429-84)
After numerous failed attempts I decided to try on my laptop
OSX 10.13.6 High Sierra
Xcode 10.1
Took many hours but built and installed successfully.
I then copied the built system to my Catalina computer and ran make install which went fine until:

Making install in sanitizer_common
/bin/sh ../libtool  --tag=CXX   --mode=compile /opt/GNAT/2021/obj/./gcc/xgcc -shared-libgcc -B/opt/GNAT/2021/obj/./gcc -nostdinc++ -L/opt/GNAT/2021/obj/x86_64-apple-darwin17.7.0/libstdc++-v3/src -L/opt/GNAT/2021/obj/x86_64-apple-darwin17.7.0/libstdc++-v3/src/.libs -L/opt/GNAT/2021/obj/x86_64-apple-darwin17.7.0/libstdc++-v3/libsupc++/.libs -B/usr/local/x86_64-apple-darwin17.7.0/bin/ -B/usr/local/x86_64-apple-darwin17.7.0/lib/ -isystem /usr/local/x86_64-apple-darwin17.7.0/include -isystem /usr/local/x86_64-apple-darwin17.7.0/sys-include   -fchecking=1 -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS  -DHAVE_RPC_XDR_H=0 -DHAVE_TIRPC_RPC_XDR_H=0 -I. -I../../../../src/libsanitizer/sanitizer_common -I..  -I ../../../../src/libsanitizer/include -I ../../../../src/libsanitizer -isystem ../../../../src/libsanitizer/include/system  -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fno-rtti -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros -I../../libstdc++-v3/include     -I../../libstdc++-v3/include/x86_64-apple-darwin17.7.0     -I../../../../src/libsanitizer/../libstdc++-v3/libsupc++ -std=gnu++11 -Wl,-undefined,dynamic_lookup   -g -O2 -MT sancov_flags.lo -MD -MP -MF .deps/sancov_flags.Tpo -c -o sancov_flags.lo ../../../../src/libsanitizer/sanitizer_common/sancov_flags.cpp
libtool: compile:  /opt/GNAT/2021/obj/./gcc/xgcc -shared-libgcc -B/opt/GNAT/2021/obj/./gcc -nostdinc++ -L/opt/GNAT/2021/obj/x86_64-apple-darwin17.7.0/libstdc++-v3/src -L/opt/GNAT/2021/obj/x86_64-apple-darwin17.7.0/libstdc++-v3/src/.libs -L/opt/GNAT/2021/obj/x86_64-apple-darwin17.7.0/libstdc++-v3/libsupc++/.libs -B/usr/local/x86_64-apple-darwin17.7.0/bin/ -B/usr/local/x86_64-apple-darwin17.7.0/lib/ -isystem /usr/local/x86_64-apple-darwin17.7.0/include -isystem /usr/local/x86_64-apple-darwin17.7.0/sys-include -fchecking=1 -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DHAVE_RPC_XDR_H=0 -DHAVE_TIRPC_RPC_XDR_H=0 -I. -I../../../../src/libsanitizer/sanitizer_common -I.. -I ../../../../src/libsanitizer/include -I ../../../../src/libsanitizer -isystem ../../../../src/libsanitizer/include/system -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fno-rtti -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros -I../../libstdc++-v3/include -I../../libstdc++-v3/include/x86_64-apple-darwin17.7.0 -I../../../../src/libsanitizer/../libstdc++-v3/libsupc++ -std=gnu++11 -Wl,-undefined,dynamic_lookup -g -O2 -MT sancov_flags.lo -MD -MP -MF .deps/sancov_flags.Tpo -c ../../../../src/libsanitizer/sanitizer_common/sancov_flags.cpp  -fno-common -DPIC -o .libs/sancov_flags.o
In file included from ../../../../src/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:15,
                 from ../../../../src/libsanitizer/sanitizer_common/sanitizer_flag_parser.h:16,
                 from ../../../../src/libsanitizer/sanitizer_common/sancov_flags.h:15,
                 from ../../../../src/libsanitizer/sanitizer_common/sancov_flags.cpp:13:
../../../../src/libsanitizer/sanitizer_common/sanitizer_platform.h:54:11: fatal error: TargetConditionals.h: No such file or directory
   54 | # include <TargetConditionals.h>
      |           ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [sancov_flags.lo] Error 1
make[2]: *** [install-recursive] Error 1
make[1]: *** [install-target-libsanitizer] Error 2
make: *** [install] Error 2

However, installation appears to have been successful to some extent:
 obj % /usr/local/bin/gnat --version
GNAT Community 2021 (20210519-103)

I've yet to see if it actually  works.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Problem building GNAT CE 2021 on Mac Catalina
  2021-06-20 10:20       ` Roger Mc
@ 2021-06-20 11:21         ` Simon Wright
  2021-06-20 11:57           ` Roger Mc
  0 siblings, 1 reply; 8+ messages in thread
From: Simon Wright @ 2021-06-20 11:21 UTC (permalink / raw)


Roger Mc <rogermcm2@gmail.com> writes:

> Making install in sanitizer_common

I build with --disable-libsanitizer; GNAT CE 2020 didn't. See the
configure options with $prefix/bin/gcc -v

My options:
https://github.com/simonjwright/building-gcc-macos-native/blob/gnat-ce/gcc.sh

I can't justify some of them :-(

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Problem building GNAT CE 2021 on Mac Catalina
  2021-06-20 11:21         ` Simon Wright
@ 2021-06-20 11:57           ` Roger Mc
  0 siblings, 0 replies; 8+ messages in thread
From: Roger Mc @ 2021-06-20 11:57 UTC (permalink / raw)


On Sunday, June 20, 2021 at 9:21:07 PM UTC+10, Simon Wright wrote:
> Roger Mc <roge...@gmail.com> writes: 
> 
> > Making install in sanitizer_common 
> 
> I build with --disable-libsanitizer; GNAT CE 2020 didn't. See the 
> configure options with $prefix/bin/gcc -v 
> 
> My options: 
> https://github.com/simonjwright/building-gcc-macos-native/blob/gnat-ce/gcc.sh 
> 
> I can't justify some of them :-(
Thanks, I'll try some.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-06-20 11:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-17 11:34 Problem building GNAT CE 2021 on Mac Catalina Roger Mc
2021-06-17 16:49 ` Simon Wright
2021-06-18  8:01   ` Roger Mc
2021-06-18 12:18     ` Roger Mc
2021-06-19  7:29       ` Roger Mc
2021-06-20 10:20       ` Roger Mc
2021-06-20 11:21         ` Simon Wright
2021-06-20 11:57           ` Roger Mc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox