* Re: Patch to config.guess (2002-07-03) to detect 64bit HPUX compiler
@ 2002-08-21 5:09 ross.alexander
2002-08-21 8:58 ` John David Anglin
0 siblings, 1 reply; 9+ messages in thread
From: ross.alexander @ 2002-08-21 5:09 UTC (permalink / raw)
To: Ben Elliston; +Cc: binutils, John David Anglin, Albert Chin, Jeff Law
Ben,
There is currently a philosophical problem with hppa*64* at the moment.
At the moment, HPUX has three possible versions for PA2.0 capable
systems, that is hppa2.0, hppa2.0n and hppa2.0w. Now hppa2.0 == hppa2.0n
but hppa2.0w indicates the OS can *execute* 64bit code. This has nothing
to do with the current build environment. Now the 2.0N vs 2.0W comes from
both the .level in PA assembly and more importantly the architecture flags
in cc (ie CC +DA2.0N vs CC +DA2.0W). However, to go back and stay hppa2.0w
== 64 build
environment rather than hppa2.0w == 64 capable OS may potentially break a
very large amount of code, and it would have to cleared though the gcc and
binutils groups.
How about the following (example)
cpu_host=`if echo "__LP64__" | $CC -E - | grep -q __LP64__; then echo
hppa2.0n; else echo hppa2.0w; fi`
---------------------------------------------------------------------------------
Ross Alexander "He knows no more about his
MIS - NEC Europe Limited destiny than a tea leaf knows
Work ph: +44 20 8752 3394 the history of East India Company"
Ben Elliston
<bje@redhat.com> To: ross.alexander@uk.neceur.com
cc:
20/08/2002 22:04 Subject: Re: Patch to config.guess (2002-07-03) to detect 64bit HPUX compiler
>>>>> "ross" == ross alexander <ross.alexander@uk.neceur.com> writes:
ross> Config.guess will return hppa64-hp-hpux??.?? if $CC produces
ross> 64bit output, ie 64bit gcc or CC +DA2.0W.
ross> (See attached file: config.guess.diff)
I am really resisting patches that use the nasty inline shell fragment
`$set_cc_for_build'. It is a constant source of frustrations. I am
loathe to use it more -- is there any way you can use other system
facilities to discover the same information?
If you look at some of the Linux detection code, there are some nice
tricks there that employ pipelines through cpp, if that's what you
need.
Ben
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Patch to config.guess (2002-07-03) to detect 64bit HPUX compiler
2002-08-21 5:09 Patch to config.guess (2002-07-03) to detect 64bit HPUX compiler ross.alexander
@ 2002-08-21 8:58 ` John David Anglin
0 siblings, 0 replies; 9+ messages in thread
From: John David Anglin @ 2002-08-21 8:58 UTC (permalink / raw)
To: ross.alexander; +Cc: bje, binutils, binutils, law
> There is currently a philosophical problem with hppa*64* at the moment.
> At the moment, HPUX has three possible versions for PA2.0 capable
> systems, that is hppa2.0, hppa2.0n and hppa2.0w. Now hppa2.0 == hppa2.0n
> but hppa2.0w indicates the OS can *execute* 64bit code. This has nothing
> to do with the current build environment. Now the 2.0N vs 2.0W comes from
> both the .level in PA assembly and more importantly the architecture flags
> in cc (ie CC +DA2.0N vs CC +DA2.0W). However, to go back and stay hppa2.0w
> == 64 build
More precisely, they descibe the PA architecture and data model of the OS.
The hppa2.0w OS architecture is LP64 and it supports two very distinct ABIs.
The default is ILP32 (this is equivalent to using the +DA1.1 option with
the HP compiler--this option is the default). The other is the 64-bit
LP64 ABI which is equivalent to the +DA2.0W compiler option. It is
possible other data models may be supported in the future (ILP32_OFFBIG,
LPBIG_OFFBIG).
When the 64-bit GNU tools were developed a few years ago, a decision was
made to use "hppa64" to select the PA2.0-LP64 tools. The other alternative
would have been to use "hppa2.0w" plus a configure option like
--with-abi=LP64. The principal reason for not using the second alternative
is that the two ABIs supported under HP-UX 11 are totally different and
require completely separate tools, libraries, etc. HP provided wrappers for
their tools but this isn't possible with the GNU tools. It's also
simpler to just use "hppa64", particularly if config.guess did an ABI
check of the compiler.
> environment rather than hppa2.0w == 64 capable OS may potentially break a
> very large amount of code, and it would have to cleared though the gcc and
> binutils groups.
Yes. I don't favor changing to the second alternative. Note that "hppa64"
is accepted by config.sub for selecting the optional ABI.
> How about the following (example)
>
> cpu_host=`if echo "__LP64__" | $CC -E - | grep -q __LP64__; then echo
> hppa2.0n; else echo hppa2.0w; fi`
Looks reasonable. Note CCOPTS may affect the result when using the
HP compiler.
Dave
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Patch to config.guess (2002-07-03) to detect 64bit HPUX compiler
@ 2002-08-23 2:40 ross.alexander
2002-08-23 14:29 ` John David Anglin
0 siblings, 1 reply; 9+ messages in thread
From: ross.alexander @ 2002-08-23 2:40 UTC (permalink / raw)
To: Ben Elliston; +Cc: binutils, John David Anglin, Albert Chin, Jeff Law
[-- Attachment #1: Type: text/plain, Size: 1489 bytes --]
Ben,
I couldn't find the code you were referring to but here is a cut of that
patch. It still requires
a C compiler but does not create temporary files. It has not been tested
with aCC but has
been with gcc, cc and cc +DA2.0W.
*** config.guess.orig Fri Aug 23 09:27:15 2002
--- config.guess Fri Aug 23 10:33:51 2002
***************
*** 625,630 ****
--- 625,639 ----
rm -f $dummy.c $dummy && rmdir $tmpdir
fi ;;
esac
+ if [ ${HP_ARCH} = "hppa2.0w" ];
+ then
+ CC_FOR_BUILD=${CC-cc}
+ if echo "__LP64__" | $CC_FOR_BUILD $CCOPTS -E - | grep -q
__LP64__; then
+ HP_ARCH="hppa2.0w"
+ else
+ HP_ARCH="hppa64"
+ fi
+ fi
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit 0 ;;
ia64:HP-UX:*:*)
(See attached file: config.guess.diff)
>>>>> "ross" == ross alexander <ross.alexander@uk.neceur.com> writes:
ross> Config.guess will return hppa64-hp-hpux??.?? if $CC produces
ross> 64bit output, ie 64bit gcc or CC +DA2.0W.
ross> (See attached file: config.guess.diff)
I am really resisting patches that use the nasty inline shell fragment
`$set_cc_for_build'. It is a constant source of frustrations. I am
loathe to use it more -- is there any way you can use other system
facilities to discover the same information?
If you look at some of the Linux detection code, there are some nice
tricks there that employ pipelines through cpp, if that's what you
need.
Ben
[-- Attachment #2: config.guess.diff --]
[-- Type: application/octet-stream, Size: 505 bytes --]
*** config.guess.orig Fri Aug 23 09:27:15 2002
--- config.guess Fri Aug 23 10:33:51 2002
***************
*** 625,630 ****
--- 625,639 ----
rm -f $dummy.c $dummy && rmdir $tmpdir
fi ;;
esac
+ if [ ${HP_ARCH} = "hppa2.0w" ];
+ then
+ CC_FOR_BUILD=${CC-cc}
+ if echo "__LP64__" | $CC_FOR_BUILD $CCOPTS -E - | grep -q __LP64__; then
+ HP_ARCH="hppa2.0w"
+ else
+ HP_ARCH="hppa64"
+ fi
+ fi
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit 0 ;;
ia64:HP-UX:*:*)
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Patch to config.guess (2002-07-03) to detect 64bit HPUX compiler
2002-08-23 2:40 ross.alexander
@ 2002-08-23 14:29 ` John David Anglin
2002-11-29 22:05 ` Ben Elliston
0 siblings, 1 reply; 9+ messages in thread
From: John David Anglin @ 2002-08-23 14:29 UTC (permalink / raw)
To: ross.alexander; +Cc: bje, binutils, binutils, law
> + if [ ${HP_ARCH} = "hppa2.0w" ];
> + then
> + CC_FOR_BUILD=${CC-cc}
Don't you want to use "eval $set_cc_for_build" to set CC_FOR_BUILD?
> + if echo "__LP64__" | $CC_FOR_BUILD $CCOPTS -E - | grep -q
> __LP64__; then
Looks like a mailer line wrap. I suspect that you don't want $CCOPTS
on the command line. It might get used with gcc when it shouldn't.
Also, given that you don't want the behavior of the package being
configured to change depending on the value of CCOPTS, I think it
best to force users to set the architecture in setting CC (e.g.,
CC="cc +DA2.0W"). This will cause a warning if a user tries to
respecify the architecture either on the command line or with CCOPTS:
-bash-2.05b$ cc +DA2.0W -c +DA1.1 main.c
cc: warning 441: Previous '+DA' or '+DD' option overridden by '+DA1.1' option.
This is particularly important for libtool which saves CC for later
use. Thus, you need something like
if echo "__LP64__" | (CCOPTS= $CC_FOR_BUILD -E -) | \
grep -q __LP64__; then
You might also check CCOPTS for +DA2.0W and +DD64, and warn the user
that these need to be set using CC to allow config.guess to correctly
guess the build configuration and ensure that the specified compiler(s)
matches the selected configuration. This isn't an issue with gcc since
there are two different compilers. However, you still have to be
careful about the PATH for gcc since libtool doesn't save it as an
absolute pathname.
Dave
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Patch to config.guess (2002-07-03) to detect 64bit HPUX compiler
2002-08-23 14:29 ` John David Anglin
@ 2002-11-29 22:05 ` Ben Elliston
2002-12-03 7:50 ` John David Anglin
0 siblings, 1 reply; 9+ messages in thread
From: Ben Elliston @ 2002-11-29 22:05 UTC (permalink / raw)
To: ross.alexander, dave; +Cc: law, binutils
On a planet far away, an unsigned long long time ago, Ross Alexander
submitted a patch to correctly detect the 64-bit HP-UX compiler.
After some debate and the obligatory four month cooling off period
:-), here is a patch that combines the input of Ross and Dave Anglin.
I tidied it up a bit and made it more portable -- by dropping, to
hopefully no effect, the -q option to grep.
Is everyone agreeable to this patch? Can someone with the right HP
systems test the patch? Thanks.
Ben
2002-11-30 Ben Elliston <bje@redhat.com>
From <ross.alexander@uk.neceur.com>:
* config.guess (*:HP-UX:*:*): Detect 64-bit compiler.
Index: config.guess
===================================================================
RCS file: /cvsroot/config/config/config.guess,v
retrieving revision 1.258
diff -u -r1.258 config.guess
--- config.guess 30 Nov 2002 05:05:28 -0000 1.258
+++ config.guess 30 Nov 2002 05:59:38 -0000
@@ -635,10 +635,21 @@
}
EOF
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
- if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
+ test -z "$HP_ARCH" && HP_ARCH=hppa
rm -f $dummy.c $dummy && rmdir $tmpdir
fi ;;
esac
+ if [ ${HP_ARCH} = "hppa2.0w" ]
+ then
+ # avoid double evaluation of $set_cc_for_build
+ test -n "$CC_FOR_BUILD" || $set_cc_for_build
+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__
+ then
+ HP_ARCH="hppa2.0w"
+ else
+ HP_ARCH="hppa64"
+ fi
+ fi
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit 0 ;;
ia64:HP-UX:*:*)
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Patch to config.guess (2002-07-03) to detect 64bit HPUX compiler
2002-11-29 22:05 ` Ben Elliston
@ 2002-12-03 7:50 ` John David Anglin
0 siblings, 0 replies; 9+ messages in thread
From: John David Anglin @ 2002-12-03 7:50 UTC (permalink / raw)
To: Ben Elliston; +Cc: ross.alexander, law, binutils
I applied the patch to config.guess in gcc-3.3. I had to apply it
manually because of minor formatting differences. It didn't work
correctly. The following appeared in the gcc build log. I was
using a 64-bit gcc as the build compiler.
../gcc/config.guess[631]: tmpdir=${TMPDIR-/tmp}/config-guess-$$: not found.
../gcc/config.guess[632]: -E: not found.
Configuring for a hppa64-hp-hpux11.11 host.
...
From the second message, it would appear that CC_FOR_BUILD was an
empty string. I'm not sure what is causing the first message.
Dave
> Is everyone agreeable to this patch? Can someone with the right HP
> systems test the patch? Thanks.
>
> Ben
>
>
> 2002-11-30 Ben Elliston <bje@redhat.com>
>
> From <ross.alexander@uk.neceur.com>:
> * config.guess (*:HP-UX:*:*): Detect 64-bit compiler.
>
> Index: config.guess
> ===================================================================
> RCS file: /cvsroot/config/config/config.guess,v
> retrieving revision 1.258
> diff -u -r1.258 config.guess
> --- config.guess 30 Nov 2002 05:05:28 -0000 1.258
> +++ config.guess 30 Nov 2002 05:59:38 -0000
> @@ -635,10 +635,21 @@
> }
> EOF
> (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
> - if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
> + test -z "$HP_ARCH" && HP_ARCH=hppa
> rm -f $dummy.c $dummy && rmdir $tmpdir
> fi ;;
> esac
> + if [ ${HP_ARCH} = "hppa2.0w" ]
> + then
> + # avoid double evaluation of $set_cc_for_build
> + test -n "$CC_FOR_BUILD" || $set_cc_for_build
> + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__
> + then
> + HP_ARCH="hppa2.0w"
> + else
> + HP_ARCH="hppa64"
> + fi
> + fi
> echo ${HP_ARCH}-hp-hpux${HPUX_REV}
> exit 0 ;;
> ia64:HP-UX:*:*)
>
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <no.id>]
* Re: Patch to config.guess (2002-07-03) to detect 64bit HPUX compiler
[not found] <no.id>
@ 2002-12-03 8:31 ` John David Anglin
2002-12-03 16:51 ` John David Anglin
0 siblings, 1 reply; 9+ messages in thread
From: John David Anglin @ 2002-12-03 8:31 UTC (permalink / raw)
To: John David Anglin; +Cc: bje, ross.alexander, law, binutils
> I applied the patch to config.guess in gcc-3.3. I had to apply it
> manually because of minor formatting differences. It didn't work
> correctly. The following appeared in the gcc build log. I was
> using a 64-bit gcc as the build compiler.
>
> ../gcc/config.guess[631]: tmpdir=${TMPDIR-/tmp}/config-guess-$$: not found.
> ../gcc/config.guess[632]: -E: not found.
> Configuring for a hppa64-hp-hpux11.11 host.
> ...
We need to eval $set_cc_for_build. I am doing a gcc bootstrap with
the patch below. I have verified that it correctly selects hppa64
when using gcc (64-bit version selected using $PATH) and the HP
bundled compiler selected with CC="cc +DA2.0W".
Dave
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
Index: config.guess
===================================================================
RCS file: /cvsroot/gcc/gcc/config.guess,v
retrieving revision 1.53
diff -u -3 -p -r1.53 config.guess
--- config.guess 20 Aug 2002 21:53:23 -0000 1.53
+++ config.guess 3 Dec 2002 16:19:35 -0000
@@ -621,10 +621,21 @@ EOF
}
EOF
(CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`$dummy`
- if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
+ test -z "$HP_ARCH" && HP_ARCH=hppa
rm -f $dummy.c $dummy && rmdir $tmpdir
fi ;;
esac
+ if [ ${HP_ARCH} = "hppa2.0w" ]
+ then
+ # avoid double evaluation of $set_cc_for_build
+ test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__
+ then
+ HP_ARCH="hppa2.0w"
+ else
+ HP_ARCH="hppa64"
+ fi
+ fi
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit 0 ;;
ia64:HP-UX:*:*)
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Patch to config.guess (2002-07-03) to detect 64bit HPUX compiler
2002-12-03 8:31 ` John David Anglin
@ 2002-12-03 16:51 ` John David Anglin
2002-12-04 1:53 ` Ben Elliston
0 siblings, 1 reply; 9+ messages in thread
From: John David Anglin @ 2002-12-03 16:51 UTC (permalink / raw)
To: John David Anglin; +Cc: bje, ross.alexander, law, binutils
> We need to eval $set_cc_for_build. I am doing a gcc bootstrap with
> the patch below. I have verified that it correctly selects hppa64
> when using gcc (64-bit version selected using $PATH) and the HP
> bundled compiler selected with CC="cc +DA2.0W".
There was a further problem... I directed the output of the
__LP64__ check to /dev/null. I guess the "-q" was necessary.
Dave
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
Index: config.guess
===================================================================
RCS file: /cvsroot/gcc/gcc/config.guess,v
retrieving revision 1.53
diff -u -3 -p -r1.53 config.guess
--- config.guess 20 Aug 2002 21:53:23 -0000 1.53
+++ config.guess 3 Dec 2002 22:29:52 -0000
@@ -621,10 +621,21 @@ EOF
}
EOF
(CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`$dummy`
- if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
+ test -z "$HP_ARCH" && HP_ARCH=hppa
rm -f $dummy.c $dummy && rmdir $tmpdir
fi ;;
esac
+ if [ ${HP_ARCH} = "hppa2.0w" ]
+ then
+ # avoid double evaluation of $set_cc_for_build
+ test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
+ then
+ HP_ARCH="hppa2.0w"
+ else
+ HP_ARCH="hppa64"
+ fi
+ fi
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit 0 ;;
ia64:HP-UX:*:*)
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Patch to config.guess (2002-07-03) to detect 64bit HPUX compiler
2002-12-03 16:51 ` John David Anglin
@ 2002-12-04 1:53 ` Ben Elliston
0 siblings, 0 replies; 9+ messages in thread
From: Ben Elliston @ 2002-12-04 1:53 UTC (permalink / raw)
To: John David Anglin; +Cc: ross.alexander, law, binutils
>>>>> "John" == John David Anglin <dave@hiauly1.hia.nrc.ca> writes:
John> There was a further problem... I directed the output of the
John> __LP64__ check to /dev/null. I guess the "-q" was necessary.
I omitted the -q in my patch because according to the GNU grep manual:
Portability note: unlike GNU grep, traditional grep did not conform
to POSIX.2, because traditional grep lacked a -q option and its -s
option behaved like GNU grep's -q option. Shell scripts intended to
be portable to traditional grep should avoid both -q and -s and
should redirect output to /dev/null instead.
However, since we can be assured that this code will only be executing
on HP-UX (and if HP-UX's native grep supports -q), I think it can go
back in.
Ben
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2002-12-04 9:53 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-21 5:09 Patch to config.guess (2002-07-03) to detect 64bit HPUX compiler ross.alexander
2002-08-21 8:58 ` John David Anglin
2002-08-23 2:40 ross.alexander
2002-08-23 14:29 ` John David Anglin
2002-11-29 22:05 ` Ben Elliston
2002-12-03 7:50 ` John David Anglin
[not found] <no.id>
2002-12-03 8:31 ` John David Anglin
2002-12-03 16:51 ` John David Anglin
2002-12-04 1:53 ` Ben Elliston
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).