| delorie.com/archives/browse.cgi | search |
| X-Authentication-Warning: | delorie.com: mail set sender to djgpp-bounces using -f |
| X-Recipient: | dj AT delorie DOT com |
| X-Recipient: | djgpp AT delorie DOT com |
| Message-ID: | <BAY139-W49232EA2418730F53832F0E6970@phx.gbl> |
| X-Originating-IP: | [131.107.0.103] |
| From: | Jay <jayk123 AT hotmail DOT com> |
| To: | DJ Delorie <dj AT delorie DOT com> |
| CC: | <djgpp AT delorie DOT com> |
| Subject: | RE: libstdc++ writev/2.04/patches upstream? |
| Date: | Tue, 8 Jul 2008 01:28:18 +0000 |
| Importance: | Low |
| In-Reply-To: | <200807072346.m67NklaB006801@envy.delorie.com> |
| References: | <200807070405 DOT m67451dZ010910 AT delorie DOT com> |
| <BAY139-W19808358F507B7930E7F6EE6940 AT phx DOT gbl> | |
| <200807071920 DOT m67JKA4v032518 AT envy DOT delorie DOT com> | |
| <BAY139-W3281EFF9FE7174C4D5C2FEE6940 AT phx DOT gbl> | |
| <200807072141 DOT m67Lf1A6003751 AT envy DOT delorie DOT com> | |
| <BAY139-W45413141F49024B6BBB218E6940 AT phx DOT gbl> | |
| <200807072346 DOT m67NklaB006801 AT envy DOT delorie DOT com> | |
| MIME-Version: | 1.0 |
| X-OriginalArrivalTime: | 08 Jul 2008 01:28:18.0809 (UTC) FILETIME=[E6DF9690:01C8E099] |
| Errors-To: | nobody AT delorie DOT com |
| X-Mailing-List: | djgpp AT delorie DOT com |
| X-Unsubscribes-To: | listserv AT delorie DOT com |
--_56ac5af7-ebda-4e62-bd57-c196aa22e7c0_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
> > Jay=20
> > You have to "cheat" in any case=2C like starting with a compiler and =
> > linker from somewhere. > > DJ > Um=2C no. I do cross co=
mpilers starting with only a native compiler and > the original sources=
. Note that writing cross development tools is my > day job - I do this=
all the time. =20
Having a native compiler and linker I label "cheating".
You have to start somewhere -- from some binaries=2C that are runnable some=
where=2C not just source.
(Yes=2C I realize even starting with a native compiler/linker and a working=
bootable computer is being spoiled.)
> And many of the tests are "run this" tests=3B=20
I admit I have not taken any inventory of compile vs. link vs. run.
Um=2C given a preexisting djcrx=2C a sys-root=2C changing the writev test t=
obe "auto" is reasonable=2C right? I have to try it out of course=2C with v=
203and v204. And=2C if you (or others) very much prefer the existing assump=
tion=2CI could make it first test if it can link anything (just main(){})=
=2C and if not=2C use thecurrent default=2C and only if it is able to link =
anything=2C then use theresult of linking to writev as a test.
Or really=2C it could be like (psuedo code!)
# # DJGPP 2.04 has writev=2C 2.03 does not. # Default to 2.04 and probe=
for 2.03. # has_write=3Dtrue # default in case libc.a not present sysro=
ot =3D prefix/target/sys-root # default sys-root if use_sysroot !=3D "" =
&& use_sysroot !=3D yes sysroot =3D use_sysroot # use specified sys-ro=
ot if exist sys-root/lib/libc.a # make sure it is minimally valid =
if nm-for-target libc.a | grep fopen if nm-for-target libc.a | g=
rep writev has_writev=3Dtrue else has_writev=3Dfal=
se
=20
If you have ld=2C you probably have nm.
No need to compile=2C except=2C well=2C maybe the compileris better at find=
ing libc.a.
=20
so maybe:
has_writev=3Dtrue # assume v2.04 default in case libc.a not present # Ca=
n we compile and link anything? if cc << int main() { }<< # Can we NOT =
link to writev? if ! cc << int main() { void* p =3D &writev=3B } =
<< has_writev=3Dfalse else
rm a.exe rm a.out else echo WARNING: unable to do autoconf=
iguration via linking for cross build=2C using defaults. end
=20
Really=2C this is pseudo code.I'll get the m4/auto*/sh right.
Also=2C maybe uname differentiates=2C though that's crude.Presumably 2.04 e=
xisted=2C in an intermediate state=2C beforewritev was added.
I believe there are other similar things being hardcoded here.I'll look int=
o it.
- Jay=
--_56ac5af7-ebda-4e62-bd57-c196aa22e7c0_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<style>
.hmmessage P
{
margin:0px=3B
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt=3B
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class=3D'hmmessage'>
 =3B >=3B >=3B Jay <BR>
 =3B >=3B >=3B You have to "cheat" in any case=2C like starting wit=
h a compiler and =3B =3B <BR> =3B >=3B >=3B linker from som=
ewhere. =3B <BR> =3B >=3B =3B =3B =3B =3B<BR>&nbs=
p=3B >=3B =3B =3B =3BDJ <BR> =3B >=3B Um=2C no. I do cr=
oss compilers starting with only a native compiler and =3B =3B <BR>=
 =3B >=3B the original sources. Note that writing cross development t=
ools is my =3B =3B <BR> =3B >=3B day job - I do this all the =
time. =3B =3B <BR>
<BR>Having a native compiler and linker I label "cheating".<BR>
You have to start somewhere -- from some binaries=2C that are runnable some=
where=2C not just source.<BR>
(Yes=2C I realize even starting with a native compiler/linker and a working=
bootable computer is being spoiled.)<BR>
<BR> =3B>=3B And many of the tests are "run this" tests=3B <BR>
<BR>I admit I have not taken any inventory of compile vs. link vs. run.<BR>
<BR>Um=2C given a preexisting djcrx=2C a sys-root=2C changing the writev te=
st to<BR>be "auto" is reasonable=2C right? I have to try it out of course=
=2C with v203<BR>and v204. And=2C if you (or others) very much prefer the e=
xisting assumption=2C<BR>I could make it first test if it can link anything=
(just main(){})=2C and if not=2C use the<BR>current default=2C and only if=
it is able to link anything=2C then use the<BR>result of linking to writev=
as a test.<BR>
<BR>Or really=2C it could be like (psuedo code!)<BR>
<BR> =3B #<BR> =3B # DJGPP 2.04 has writev=2C 2.03 does not.<BR>&nb=
sp=3B # Default to 2.04 and probe for 2.03.<BR> =3B #<BR> =3B has_w=
rite=3Dtrue # default in case libc.a not present<BR> =3B sysroot =3D pr=
efix/target/sys-root # default sys-root<BR> =3B =3B =3B if use_=
sysroot !=3D "" &=3B&=3B use_sysroot !=3D yes<BR> =3B =3B&nbs=
p=3B =3B =3B sysroot =3D use_sysroot # use specified sys-root<BR>&n=
bsp=3B =3B =3B if exist sys-root/lib/libc.a<BR> =3B =3B&nbs=
p=3B =3B =3B # make sure it is minimally valid<BR> =3B =3B&=
nbsp=3B =3B =3B if nm-for-target libc.a | grep fopen<BR> =3B&nb=
sp=3B =3B =3B =3B =3B =3B if nm-for-target libc.a | gre=
p writev<BR> =3B =3B =3B =3B =3B =3B =3B =
=3B =3B has_writev=3Dtrue<BR> =3B =3B =3B =3B =3B&n=
bsp=3B =3B else<BR> =3B =3B =3B =3B =3B =3B&nbs=
p=3B =3B =3B has_writev=3Dfalse<BR>
 =3B<BR>
If you have ld=2C you probably have nm.<BR><BR>
No need to compile=2C except=2C well=2C maybe the compiler<BR>is better at =
finding libc.a.<BR>
 =3B<BR>
so maybe:<BR>
 =3B has_writev=3Dtrue # assume v2.04 default in case libc.a not presen=
t<BR> =3B # Can we compile and link anything?<BR> =3B if cc <=3B&=
lt=3B<BR> =3Bint main() { }<BR><=3B<=3B<BR> =3B =3B =3B=
# Can we NOT link to writev?<BR> =3B =3B =3B if ! cc <=3B<=
=3B =3B<BR> =3B =3B =3B =3B =3B int main() { void* =
p =3D &=3Bwritev=3B }<BR> =3B =3B =3B <=3B<=3B <BR> =
=3B =3B =3B =3B =3B has_writev=3Dfalse<BR> =3B =3B&=
nbsp=3B else<BR>
 =3B =3B =3B =3B =3B rm a.exe =3B<BR> =3B =
=3B =3B =3B =3B rm a.out =3B<BR> =3B else<BR> =3B&n=
bsp=3B =3B echo WARNING: unable to do autoconfiguration via linking for=
cross build=2C using defaults.<BR> =3B end<BR>
 =3B<BR>
Really=2C this is pseudo code.<BR>I'll get the m4/auto*/sh right.<BR>
<BR>Also=2C maybe uname differentiates=2C though that's crude.<BR>Presumabl=
y 2.04 existed=2C in an intermediate state=2C before<BR>writev was added.<B=
R>
<BR>I believe there are other similar things being hardcoded here.<BR>I'll =
look into it.<BR>
<BR> =3B- Jay<BR><BR></body>
</html>=
--_56ac5af7-ebda-4e62-bd57-c196aa22e7c0_--
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |