Operating System - HP-UX
1753767 Members
5733 Online
108799 Solutions
New Discussion юеВ

Re: GCC PA-RISC1.1 in PA-RISC2.0 Build Outputs

 
SOLVED
Go to solution
Kevin Schultz
Advisor

GCC PA-RISC1.1 in PA-RISC2.0 Build Outputs

Dear ITRC forums community,

I have installed GCC 4.0.0 with PA-RISC2.0 32-bit on HPUX 11.00. To verify:

sh # find /usr/local/pa20_32/ | xargs file | grep 2.0 | grep gcc:

/usr/local/pa20_32/bin/gcc: PA-RISC2.0 shared executable dynamically linked -not stripped
/usr/local/pa20_32/bin/hppa2.0w-hp-hpux11.00-gcc: PA-RISC2.0 shared executable dynamically linked -not stripped


I feel concerned, however, by the existence of PA-RISC1.1 files, because I want my entire distribution to be consistently PA-RISC2.0:

sh # find /usr/local/pa20_32/ | xargs file | grep 1.1

/usr/local/pa20_32/lib/gcc/hppa2.0w-hp-hpux11.00/4.0.0/libgcc.a: archive file -PA-RISC1.1 relocatable library
/usr/local/pa20_32/lib/gcc/hppa2.0w-hp-hpux11.00/4.0.0/libgcov.a: archive file -PA-RISC1.1 relocatable library
/usr/local/pa20_32/lib/libiberty.a: archive file -PA-RISC1.1 relocatable library
/usr/local/pa20_32/lib/libsupc++.a: archive file -PA-RISC1.1 relocatable library
/usr/local/pa20_32/lib/libstdc++.a: archive file -PA-RISC1.1 relocatable library
/usr/local/pa20_32/lib/libobjc.a: archive file -PA-RISC1.1 relocatable library

I am running on HPUX 11.00:

uname -a
HP-UX voltaire B.11.00 U 9000/785 2015073023 unlimited-user license

Here are the configure options from my last compile:

sh # /usr/local/bin/gcc -v
Using built-in specs.
Target: hppa2.0w-hp-hpux11.00
Configured with: ../gcc-4.0.0/configure --prefix=/usr/local/pa20_32 --with-gnu-as --with-as=/usr/local/pa20_32/bin/as --disable-nls --enable-threads=posix95 --with-gmp=/usr/local/pa20_32 --with-mpfr=/usr/local/pa20_32 --disable-shared --enable-languages=c,c++,objc
Thread model: posix95
gcc version 4.0.0

Here is the full configure line I used at the command prompt (/opt/bin/cc is HP Ansi C):

PATH=/usr/local/pa20_32/bin:$PATH CC=/opt/bin/cc ../gcc-4.0.0/configure --prefix=/usr/local/pa20_32 --with-gnu-as --with-as=/usr/local/pa20_32/bin/as --disable-nls --enable-threads=posix95 --with-gmp=/usr/local/pa20_32 --with-mpfr=/usr/local/pa20_32 --disable-shared --enable-languages=c,c++,objc 2>&1 | tee ~/tmp/cgcc.out

Here is the gmake command:

PATH=/usr/local/pa20_32/bin:$PATH gmake -j2 2>&1 | tee ~/tmp/mgcc.out

Is this behavior expected? Thanks for any feedback.

Best regards,



Kevin Schultz
Roseville, CA
7 REPLIES 7
H.Merijn Brand (procura
Honored Contributor
Solution

Re: GCC PA-RISC1.1 in PA-RISC2.0 Build Outputs

I think it is.

The *archive* is in that form. If you want to know about the *objects* in the archive, extract them and check

# cd /tmp
# mkdir test
# cd test
# ar x /usr/local/pa20_32/lib/gcc/hppa2.0w-hp-hpux11.00/4.0.0/libgcc.a
# file *

If I'm back at work, I'll check what it shows in my situation.

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Kevin Schultz
Advisor

Re: GCC PA-RISC1.1 in PA-RISC2.0 Build Outputs

Yep, they are all PA-RISC1.1:

schultkl@voltaire: /tmp/test $ file *
__gcc_bcmp.o: PA-RISC1.1 relocatable object
__main.o: PA-RISC1.1 relocatable object
_absvdi2.o: PA-RISC1.1 relocatable object
_absvsi2.o: PA-RISC1.1 relocatable object
_addvdi3.o: PA-RISC1.1 relocatable object
_addvsi3.o: PA-RISC1.1 relocatable object
_ashldi3.o: PA-RISC1.1 relocatable object
_ashrdi3.o: PA-RISC1.1 relocatable object
_clear_cache.o: PA-RISC1.1 relocatable object
_clz.o: PA-RISC1.1 relocatable object
_clzdi2.o: PA-RISC1.1 relocatable object
_clzsi2.o: PA-RISC1.1 relocatable object
...

Best regards,



Kevin
Steve Ellcey
Valued Contributor

Re: GCC PA-RISC1.1 in PA-RISC2.0 Build Outputs

I believe the PA32 GCC compiler will default to PA1.1 code even when built on a PA2.0 box. You may need to set CFLAGS to -mpa-risc-2-0 to get a GCC built as a PA2.0 binary. Note that I think that GCC built this way will still generate PA1.1 code by default. Users of that GCC will also need to specify -mpa-risc-2-0 to get PA2.0 code unless you actually edit the GCC sources to make PA2.0 code generation the default.
Kevin Schultz
Advisor

Re: GCC PA-RISC1.1 in PA-RISC2.0 Build Outputs

Hi Steve,

Yes, I did more compiling with gcc Monday evening and you seem to be correct with saying that gcc by default produces PA-RISC1.1 code instead of PA-RISC2.0 code. I seem to have forgotten this flag, hehehe

Here is my latest compilation:

PATH=/usr/local/pa20_64/bin:$PATH CFLAGS="-O2 -mpa-risc-2-0 -mschedule=8000 -munix=95 -fPIC -static -Dhpux -DSYSV -D_HPUX_SOURCE -D_POSIX_C_SOURCE=199506L -D_POSIX_D10_THREADS" CC=/usr/local/bin/gcc ../gcc-4.0.0/configure --prefix=/usr/local/pa20_64 --enable-threads --enable-threads=posix95 --with-gnu-as --with-as=/usr/local/pa20_64/bin/as --disable-nls --with-gmp=/usr/local/pa20_64 --with-mpfr=/usr/local/pa20_64 --disable-shared --enable-languages=c,c++ 2>&1 | tee ~/tmp/cgcc.out

Unfortunately, this still compiles and installs libiberty as PA-RISC-1.1. Ugh! I must be doing something wrong but I do not know what.

Best regards,



Kevin
Kevin Schultz
Advisor

Re: GCC PA-RISC1.1 in PA-RISC2.0 Build Outputs

oops, that should have been "pa20_32" instead of "pa20_64". I am recording all of my commands on a spreadsheet and copied from the 64-bit side instead of the 32-bit side. :P I am working (playing, really, hehehe) on compiling 64-bit now. :)

Best regards,



Kevin
Steve Ellcey
Valued Contributor

Re: GCC PA-RISC1.1 in PA-RISC2.0 Build Outputs

I am not sure what the default make target is, it might be a bootstrap build in which case you need to set BOOT_CFLAGS in addition to regular CFLAGS in order to get a final build with the options you want.
Kevin Schultz
Advisor

Re: GCC PA-RISC1.1 in PA-RISC2.0 Build Outputs

Thanks for the tip. I will investigate.

Best regards,



Kevin