Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 520154

Summary: dev-lang/gnat-gcc-4.7.3 ?/gnatboot-4.6 - add HPPA support
Product: Gentoo Linux Reporter: Tom Williams <tom>
Component: Current packagesAssignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it <maintainer-needed>
Status: RESOLVED WONTFIX    
Severity: enhancement CC: esigra, hppa
Priority: Normal Keywords: EBUILD
Version: unspecified   
Hardware: HPPA   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: gnatbuild.eclass
gnat-gcc-4.6.4.ebuild
gnat-gcc-4.7.3.ebuild
gnatbuild.eclass
gnat-gcc-4.7.4.ebuild
gnatbuild.eclass
gnat-gcc-4.8.4.ebuild

Description Tom Williams 2014-08-17 23:16:16 UTC
Please find here a modified eclass (gnatbuild.eclass) and some ebuilds for GNAT (GCC edition) 4.6.4 and 4.7.3 that can now be compiled on HPPA machines using the gnatboot archive available for this platform at http://bertha.gurumeditation.org.uk/gnatboot-4.6-hppa2.0.tar.gz

The eclass/builds are the work of George Shapovalov/Steve Arnold with minimal tweaks to allow for a newer slot for gnatboot HPPA, and to adjust the initial configure recipe: enable checking, and threading model changes for 4.7+

gnatboot was prepared in a minimal Debian chroot using their 4.6.4 gnatgcc to build a toolchain for hppa2.0-unknown-linux-gnu. It should be possible to make one for hppa1.1 now the full compiler can be built.

4.7.3 builds successfully on my machine (PA8700+) and compiles arbitrary Ada programs that run without issue, but you need USE=-lto at present - there is an issue with COLLECT_LTO and finding the LTO plugin that I haven't found a solution to at present.

I don't how many (if any) use Ada on PA/Linux but if you do (or want to) I hope this spare-time effort helps. It ought to build the newer GCCs too with new ebuilds - most of the build logic is inside the eclass.
Comment 1 Tom Williams 2014-08-17 23:18:14 UTC
Created attachment 383054 [details]
gnatbuild.eclass
Comment 2 Tom Williams 2014-08-17 23:18:28 UTC
Created attachment 383056 [details]
gnat-gcc-4.6.4.ebuild
Comment 3 Tom Williams 2014-08-17 23:18:43 UTC
Created attachment 383058 [details]
gnat-gcc-4.7.3.ebuild
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2014-08-17 23:41:48 UTC
Comment on attachment 383054 [details]
gnatbuild.eclass

That's a lot of changes to an eclass.


--- gnatbuild.eclass    2014-07-15 18:30:14.314910040 +0200
+++ -   2014-08-18 01:41:00.028633793 +0200
@@ -491,21 +491,30 @@           
                                fi
                                
                                if version_is_at_least 4.6 ; then
-                                       confgcc+=( $(use_enable lto) )
+                                       confgcc="${confgcc} $(use_enable lto)"
                                else
-                                       confgcc+=( --disable-lto )
+                                       confgcc="${confgcc} --disable-lto"
                                fi
                                
                                # reasonably sane globals (from toolchain)
                                # also disable mudflap and ssp
                                confgcc="${confgcc} \
                                        --with-system-zlib \
-                                       --disable-checking \
                                        --disable-werror \
                                        --disable-libgomp \
                                        --disable-libmudflap \
                                        --disable-libssp \
                                        --disable-libunwind-exceptions"
+
+                               if [[ ${ARCH} == "hppa" ]]; then
+                                       # hppa needs --disable-checking as far as 4.7
+                                       if version_is_at_least 4.8 ; then
+                                               confgcc="${confgcc} --disable-checking"
+                                       fi
+                               else
+                                       # other arches: whatever, this was the default before
+                                       confgcc="${confgcc} --disable-checking"
+                               fi
                                
                                if in_iuse openmp ; then
                                        # Make sure target has pthreads support. #326757 #335883
@@ -541,10 +550,13 @@           
                                fi
                                
                                # set some specifics available in later versions
-                               if version_is_at_least 4.3 ; then
+                               if version_is_at_least 4.3; then
                                        einfo "setting gnat thread model"
                                        confgcc="${confgcc} --enable-threads=gnat"
                                        confgcc="${confgcc} --enable-shared=boehm-gc,ada,libada"
+                               elif version_is_at_least 4.7; then
+                                       confgcc="${confgcc} --enable-threads=posix"
+                                       confgcc="${confgcc} --enable-shared=boehm-gc,ada,libada"
                                else    
                                        confgcc="${confgcc} --enable-threads=posix"
                                        confgcc="${confgcc} --enable-shared"
@@ -558,26 +570,24 @@           
                                fi
                                
                                # __cxa_atexit is "essential for fully standards-compliant handling of
-                               # destructors", but apparently requires glibc.
-                               if [[ ${CTARGET} == *-gnu* ]] ; then
-                                       confgcc="${confgcc} --enable-__cxa_atexit"
-                                       confgcc="${confgcc} --enable-clocale=gnu"
-                               fi
-
-                               einfo "confgcc=${confgcc}"
-
+                               # destructors", but apparently requires glibc
+                               confgcc="${confgcc} --enable-__cxa_atexit"
+                               confgcc="${confgcc} --enable-clocale=gnu"
+                               
                                # need to strip graphite flags or we'll get the
                                # dreaded C compiler cannot create executables...
                                # error.
                                strip-flags -floop-interchange -floop-strip-mine -floop-block
-
+
+                               einfo "configure recipe: ${confgcc}"
+                               
                                cd "${GNATBUILD}"
                                CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" "${S}"/configure \
                                        --prefix=${PREFIX} \
                                        --bindir=${BINPATH} \
-                                       --includedir=${INCLUDEPATH} \
                                        --libdir="${LIBPATH}" \
                                        --libexecdir="${LIBEXECPATH}" \
+                                       --includedir=${INCLUDEPATH} \
                                        --datadir=${DATAPATH} \
                                        --mandir=${DATAPATH}/man \
                                        --infodir=${DATAPATH}/info \
Comment 5 Tom Williams 2014-08-23 18:46:08 UTC
The latest ebuild I've tested that works is 4.7.4, attached.

A tidier, edit-reduced eclass is attached; the 'new' bash array logic for --{en|dis}able-lto doesn't seem to work properly here, hence the return to strings - and the rest of the file uses strings anyway it appears.

The compiler produced seems to be stable and produce functioning executables. The next stage is to run the ACATS test suite to verify its behaviour, but I have high hopes.
Comment 6 Tom Williams 2014-08-23 18:50:10 UTC
Created attachment 383468 [details]
gnatbuild.eclass
Comment 7 Tom Williams 2014-08-23 18:50:36 UTC
Created attachment 383470 [details]
gnat-gcc-4.7.4.ebuild
Comment 8 Tom Williams 2014-08-23 19:53:36 UTC
Also, note that --enable-threads=gnat doesn't work after 4.6.x - it seems the GNAT threads package has been removed; --enable-threads=posix is used for 4.7 (and later, if a later ebuild is created).

A test of tasking capabilities showed multiple threads created under the test program's PID (using top(1) in threads view) so the POSIX threads package seems to work with Ada.
Comment 9 Erik 2014-12-27 19:14:40 UTC
/usr/portage/eclass/gnatbuild.eclass was modified 2014-10-17. Your file is from 2014-08-23. They seem to have diverged and need to be merged.
Comment 10 Erik 2014-12-27 19:27:12 UTC
Created attachment 392532 [details]
gnatbuild.eclass

The attachment is an attempt to merge the gnatbuild.eclass from 2014-08-23 with the one in portage.
Comment 11 Erik 2014-12-28 08:18:07 UTC
I tried the eclass and ebuild in /usr/local/portage. I had to remove "
	hppa?	( http://bertha.gurumeditation.org.uk/gnatboot-${HPPA_BOOT_SLOT}-hppa2.0.tar.gz )" from it because the URI did not work.

Unfortunately, this was the tragic end:
/bin/sh ./libtool --tag=CXX   --mode=compile /var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/build/./gcc/g++ -B/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/build/./gcc/ -nostdinc++ -nostdinc++ -I/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/build/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu -I/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/build/x86_64-pc-linux-gnu/libstdc++-v3/include -I/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/gcc-4.7.4/libstdc++-v3/libsupc++ -I/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/gcc-4.7.4/libstdc++-v3/include/backward -I/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/gcc-4.7.4/libstdc++-v3/testsuite/util -L/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/build/x86_64-pc-linux-gnu/libstdc++-v3/src -L/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/build/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -B/usr/x86_64-pc-linux-gnu/bin/ -B/usr/x86_64-pc-linux-gnu/lib/ -isystem /usr/x86_64-pc-linux-gnu/include -isystem /usr/x86_64-pc-linux-gnu/sys-include    -DHAVE_CONFIG_H -I. -I/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/gcc-4.7.4/libitm  -I/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/gcc-4.7.4/libitm/config/linux/x86 -I/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/gcc-4.7.4/libitm/config/linux -I/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/gcc-4.7.4/libitm/config/x86 -I/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/gcc-4.7.4/libitm/config/posix -I/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/gcc-4.7.4/libitm/config/generic -I/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/gcc-4.7.4/libitm  -Wall -Werror  -Wc,-pthread -mavx -std=gnu++0x -funwind-tables -fno-exceptions -fno-rtti -fabi-version=4 -fno-stack-protector -march=native -pipe -O2 -D_GNU_SOURCE -MT x86_avx.lo -MD -MP -MF .deps/x86_avx.Tpo -c -o x86_avx.lo /var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/gcc-4.7.4/libitm/config/x86/x86_avx.cc
libtool: compile:  /var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/build/./gcc/g++ -B/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/build/./gcc/ -nostdinc++ -nostdinc++ -I/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/build/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu -I/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/build/x86_64-pc-linux-gnu/libstdc++-v3/include -I/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/gcc-4.7.4/libstdc++-v3/libsupc++ -I/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/gcc-4.7.4/libstdc++-v3/include/backward -I/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/gcc-4.7.4/libstdc++-v3/testsuite/util -L/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/build/x86_64-pc-linux-gnu/libstdc++-v3/src -L/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/build/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -B/usr/x86_64-pc-linux-gnu/bin/ -B/usr/x86_64-pc-linux-gnu/lib/ -isystem /usr/x86_64-pc-linux-gnu/include -isystem /usr/x86_64-pc-linux-gnu/sys-include -DHAVE_CONFIG_H -I. -I/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/gcc-4.7.4/libitm -I/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/gcc-4.7.4/libitm/config/linux/x86 -I/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/gcc-4.7.4/libitm/config/linux -I/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/gcc-4.7.4/libitm/config/x86 -I/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/gcc-4.7.4/libitm/config/posix -I/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/gcc-4.7.4/libitm/config/generic -I/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/gcc-4.7.4/libitm -Wall -pthread -Werror -mavx -std=gnu++0x -funwind-tables -fno-exceptions -fno-rtti -fabi-version=4 -fno-stack-protector -march=native -pipe -O2 -D_GNU_SOURCE -MT x86_avx.lo -MD -MP -MF .deps/x86_avx.Tpo -c /var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/gcc-4.7.4/libitm/config/x86/x86_avx.cc -o x86_avx.o
In file included from /var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/usr/lib/include/immintrin.h:48:0,
                 from /var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/gcc-4.7.4/libitm/config/x86/target.h:82,
                 from /var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/gcc-4.7.4/libitm/libitm_i.h:82,
                 from /var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/gcc-4.7.4/libitm/config/x86/x86_avx.cc:27:
/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/usr/lib/include/smmintrin.h:25:1: error: "/*" within comment [-Werror=comment]
In file included from /var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/usr/lib/include/immintrin.h:56:0,
                 from /var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/gcc-4.7.4/libitm/config/x86/target.h:82,
                 from /var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/gcc-4.7.4/libitm/libitm_i.h:82,
                 from /var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/gcc-4.7.4/libitm/config/x86/x86_avx.cc:27:
/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/usr/lib/include/avxintrin.h: In function ‘__m128d _mm_maskload_pd(const double*, __m128d)’:
/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/usr/lib/include/avxintrin.h:896:23: error: cannot convert ‘__m128d {aka __vector(2) double}’ to ‘__vector(2) long long int’ for argument ‘2’ to ‘__vector(2) double __builtin_ia32_maskloadpd(const __vector(2) double*, __vector(2) long long int)’
/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/usr/lib/include/avxintrin.h: In function ‘void _mm_maskstore_pd(double*, __m128d, __m128d)’:
/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/usr/lib/include/avxintrin.h:902:70: error: cannot convert ‘__m128d {aka __vector(2) double}’ to ‘__vector(2) long long int’ for argument ‘2’ to ‘void __builtin_ia32_maskstorepd(__vector(2) double*, __vector(2) long long int, __vector(2) double)’
/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/usr/lib/include/avxintrin.h: In function ‘__m256d _mm256_maskload_pd(const double*, __m256d)’:
/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/usr/lib/include/avxintrin.h:909:19: error: cannot convert ‘__m256d {aka __vector(4) double}’ to ‘__vector(4) long long int’ for argument ‘2’ to ‘__vector(4) double __builtin_ia32_maskloadpd256(const __vector(4) double*, __vector(4) long long int)’
/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/usr/lib/include/avxintrin.h: In function ‘void _mm256_maskstore_pd(double*, __m256d, __m256d)’:
/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/usr/lib/include/avxintrin.h:915:73: error: cannot convert ‘__m256d {aka __vector(4) double}’ to ‘__vector(4) long long int’ for argument ‘2’ to ‘void __builtin_ia32_maskstorepd256(__vector(4) double*, __vector(4) long long int, __vector(4) double)’
/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/usr/lib/include/avxintrin.h: In function ‘__m128 _mm_maskload_ps(const float*, __m128)’:
/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/usr/lib/include/avxintrin.h:922:22: error: cannot convert ‘__m128 {aka __vector(4) float}’ to ‘__vector(4) int’ for argument ‘2’ to ‘__vector(4) float __builtin_ia32_maskloadps(const __vector(4) float*, __vector(4) int)’
/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/usr/lib/include/avxintrin.h: In function ‘void _mm_maskstore_ps(float*, __m128, __m128)’:
/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/usr/lib/include/avxintrin.h:928:70: error: cannot convert ‘__m128 {aka __vector(4) float}’ to ‘__vector(4) int’ for argument ‘2’ to ‘void __builtin_ia32_maskstoreps(__vector(4) float*, __vector(4) int, __vector(4) float)’
/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/usr/lib/include/avxintrin.h: In function ‘__m256 _mm256_maskload_ps(const float*, __m256)’:
/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/usr/lib/include/avxintrin.h:935:18: error: cannot convert ‘__m256 {aka __vector(8) float}’ to ‘__vector(8) int’ for argument ‘2’ to ‘__vector(8) float __builtin_ia32_maskloadps256(const __vector(8) float*, __vector(8) int)’
/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/usr/lib/include/avxintrin.h: In function ‘void _mm256_maskstore_ps(float*, __m256, __m256)’:
/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/usr/lib/include/avxintrin.h:941:73: error: cannot convert ‘__m256 {aka __vector(8) float}’ to ‘__vector(8) int’ for argument ‘2’ to ‘void __builtin_ia32_maskstoreps256(__vector(8) float*, __vector(8) int, __vector(8) float)’
cc1plus: all warnings being treated as errors
Makefile:517: recipe for target 'x86_avx.lo' failed
make[4]: *** [x86_avx.lo] Error 1
make[4]: Leaving directory '/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/build/x86_64-pc-linux-gnu/libitm'
Makefile:697: recipe for target 'all-recursive' failed
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory '/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/build/x86_64-pc-linux-gnu/libitm'
Makefile:360: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/build/x86_64-pc-linux-gnu/libitm'
Makefile:14505: recipe for target 'all-target-libitm' failed
make[1]: *** [all-target-libitm] Error 2
make[1]: Leaving directory '/var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/build'
Makefile:15328: recipe for target 'bootstrap' failed
make: *** [bootstrap] Error 2
emake failed
Comment 12 Erik 2014-12-28 08:58:15 UTC
It is strange that when I go into /var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/build and execute "make bootstrap", it succeeds. The files 86_avx.lo and 86_avx.o are created in ./x86_64-pc-linux-gnu/libitm.

The first error ("/*" within comment), seems to be fixed in [https://gcc.gnu.org/viewcvs/gcc/trunk/gcc/config/i386/smmintrin.h?r1=184997&r2=185352]. So the version in gcc-4.7.4 is simply outdated. I am trying 4.9.2 instead.
Comment 13 Jeroen Roovers (RETIRED) gentoo-dev 2014-12-28 09:02:12 UTC
(In reply to Erik from comment #12)
> It is strange that when I go into
> /var/tmp/portage/dev-lang/gnat-gcc-4.7.4/work/build and execute "make
> bootstrap", it succeeds. The files 86_avx.lo and 86_avx.o are created in
> ./x86_64-pc-linux-gnu/libitm.

Er, this doesn't look like it's about HPPA any more. What are you doing here?
Comment 14 Erik 2014-12-28 10:26:35 UTC
(In reply to Jeroen Roovers from comment #13)
> Er, this doesn't look like it's about HPPA any more. What are you doing here?

That is right, I use amd64. Like I said in comment #11, I tested the proposed eclass and ebuild.
Comment 15 Erik 2014-12-28 12:25:05 UTC
I tried to copy Tom's ebuild to gnat-gcc-4.9.2 and emerge that instead. Unfortunately it endend like this:
/var/tmp/portage/dev-lang/gnat-gcc-4.9.2/work/build/./gcc/xgcc -B/var/tmp/portage/dev-lang/gnat-gcc-4.9.2/work/build/./gcc/ -B/usr/x86_64-pc-linux-gnu/bin/ -B/usr/x86_64-pc-linux-gnu/lib/ -isystem /usr/x86_64-pc-linux-gnu/include -isystem /usr/x86_64-pc-linux-gnu/sys-include    -g -fno-stack-protector -march=native -pipe -O2 -O2  -g -fno-stack-protector -march=native -pipe -O2 -DIN_GCC    -W -Wall -Wwrite-strings -Wcast-qual -Wno-format -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fpic -mlong-double-80 -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector   -fpic -mlong-double-80 -I. -I. -I../.././gcc -I/var/tmp/portage/dev-lang/gnat-gcc-4.9.2/work/gcc-4.9.2/libgcc -I/var/tmp/portage/dev-lang/gnat-gcc-4.9.2/work/gcc-4.9.2/libgcc/. -I/var/tmp/portage/dev-lang/gnat-gcc-4.9.2/work/gcc-4.9.2/libgcc/../gcc -I/var/tmp/portage/dev-lang/gnat-gcc-4.9.2/work/gcc-4.9.2/libgcc/../include -I/var/tmp/portage/dev-lang/gnat-gcc-4.9.2/work/gcc-4.9.2/libgcc/config/libbid -DENABLE_DECIMAL_BID_FORMAT -DHAVE_CC_TLS  -DUSE_TLS -o cpuinfo.o -MT cpuinfo.o -MD -MP -MF cpuinfo.dep  -c /var/tmp/portage/dev-lang/gnat-gcc-4.9.2/work/gcc-4.9.2/libgcc/config/i386/cpuinfo.c -fvisibility=hidden -DHIDE_EXPORTS
/var/tmp/portage/dev-lang/gnat-gcc-4.9.2/work/gcc-4.9.2/libgcc/config/i386/cpuinfo.c: In function ‘get_available_features’:
/var/tmp/portage/dev-lang/gnat-gcc-4.9.2/work/gcc-4.9.2/libgcc/config/i386/cpuinfo.c:279:17: error: ‘bit_AVX2’ undeclared (first use in this function)


I noticed that cpuinfo.c includes "cpuid.h". I searched for it:
$ find /var/tmp/portage/dev-lang/gnat-gcc-4.9.2 -name cpuid.h
/var/tmp/portage/dev-lang/gnat-gcc-4.9.2/work/build/gcc/include/cpuid.h
/var/tmp/portage/dev-lang/gnat-gcc-4.9.2/work/gcc-4.9.2/gcc/config/i386/cpuid.h
/var/tmp/portage/dev-lang/gnat-gcc-4.9.2/work/usr/lib/include/cpuid.h

So there are 3 files with that name in the ebuild's work directory. The first 2 are identical and define bit_AVX2. The third one does not. So the build seems to find the wrong one to include in cpuinfo.c. Why? From where comes the third one? How can the build be made to not use it?
Comment 16 Erik 2014-12-30 21:44:44 UTC
Created attachment 392714 [details]
gnat-gcc-4.8.4.ebuild

I copied Tom's ebuilt to gnat-gcc-4.8.4.ebuild and made some modifications that were necessary to emerge it: I removed the broken link to his HPPA bootstrap package and added a step in src_unpack to remove some conflicting files.

After emerge, i had to execute:
mv /usr/x86_64-pc-linux-gnu/gnat-gcc-bin/4.8/{gnat,}gnatmake
mv /usr/x86_64-pc-linux-gnu/gnat-gcc-bin/4.8/{gnat,}gnatbind
mv /usr/x86_64-pc-linux-gnu/gnat-gcc-bin/4.8/{gnat,}gnatlink
mv /usr/x86_64-pc-linux-gnu/gnat-gcc-bin/4.8/{gnat,}gnatchop
mv /usr/x86_64-pc-linux-gnu/gnat-gcc-bin/4.8/{gnat,}gnat
mv /usr/x86_64-pc-linux-gnu/gnat-gcc-bin/4.8/{gnat,}gnatclean
mv /usr/x86_64-pc-linux-gnu/gnat-gcc-bin/4.8/{gnat,}gnatfind
mv /usr/x86_64-pc-linux-gnu/gnat-gcc-bin/4.8/{gnat,}gnatkr
mv /usr/x86_64-pc-linux-gnu/gnat-gcc-bin/4.8/{gnat,}gnatls
mv /usr/x86_64-pc-linux-gnu/gnat-gcc-bin/4.8/{gnat,}gnatname
mv /usr/x86_64-pc-linux-gnu/gnat-gcc-bin/4.8/{gnat,}gnatprep
mv /usr/x86_64-pc-linux-gnu/gnat-gcc-bin/4.8/{gnat,}gnatxref

Now I have a working (as it seems) gnat-gcc 4.8.4! I could compile and run my test program. Please test and replace the broken 4.6 in portage with 4.8!
Comment 17 Tom Williams 2015-01-02 12:41:19 UTC
Erik - I note your diligent efforts, though I think you've addressed ebuild issues not related to the HPPA aspect that my original report was made to address; as such they are not relevant to the issue this bug was opened for. 

Given the upstream eclass has been modified as you originally noted, the changes you've made should be rebased on that in-tree eclass, not my work here, and any fix that remains necessary contributed to the Ada project team, probably under a new bug report.

For my part I'll find somewhere to host the HPPA gnatboot archive and update my small fixes to work with the in-tree build, since the original site hosting it is down, then look at more up-to-date builds than 4.7..
Comment 18 George Shapovalov (RETIRED) gentoo-dev 2015-01-13 18:08:17 UTC
Erik: thanks for your effort! Although, it is true that it derails the original bug a bit (and makes it a bit harder to process overal) - it would have been better to create a new bug for the hppa non-specific changes. Still, good work!

I was trying recently to have another go at gnat-gcc and was hitting that avx bug, for which I found some patch which allowed it to proceed some more but still was failing with avx bug, just different.. (so, that resulted in no commits, unfortunately). I'll take a look at your changes and adapt the latest version to include them. Then, hopefully, I'll be able to take a look at hppa specific parts. I will need the testing though afterwards (I am on amd64)..
Comment 19 Carlo 2016-12-13 22:11:00 UTC
I can't download the gnat-hppa-bootstrap
any news ?
Comment 20 Tom Williams 2017-01-31 17:57:39 UTC
I still have the HPPA 4.6 bootstrap which will build 4.7 and 4.8 gnat. Ideally it needs to live with the other arch bootstraps on distfiles.gentoo.org. I have no idea how to put it there :) but delighted to supply it if needed.
Comment 21 Pacho Ramos gentoo-dev 2017-08-30 18:51:58 UTC
removed