* Re: Fwd: LFS'ing an alpha, continued
@ 2002-11-13 13:06 Kelledin
2002-11-13 18:08 ` Michal Jaegermann
0 siblings, 1 reply; 14+ messages in thread
From: Kelledin @ 2002-11-13 13:06 UTC (permalink / raw)
To: axp-list
On Tuesday 12 November 2002 08:45 pm, Michal Jaegermann wrote:
> On Tue, Nov 12, 2002 at 07:00:41PM -0500, Kelledin wrote:
> > Third, netkit-base needs a patch, else the "ping" utility
> > isn't 64-bit clean (see below).
> >
> > - printf(" time=%ld.%ld ms",
> > triptime/10, + printf("
> > time=%hd.%hd ms", triptime/10,
>
> Eh??? You switched a long conversion flag for an integer
> specifier in printf() to short to make 'ping' 64-bit clean?
> Whatever you think this does it is not doing anything overly
> useful.
What really fixed it is probably the
"__attribute__((aligned(sizeof(long))))" bit in the other part
of the patch. The extra stuff (the whitespace, and the
different conversion specifier) is probably just stylistic
changes--the patch was apparently produced by a Gentoo developer
found by google, not by me. ;)
Without the patch, the "ping" utility works for the alpha box
pinging itself, but not for it pinging any of the other (x86)
boxen on my local network. With the patch, the "ping" utility
compiles and works as intended, on either x86 or on alpha.
> Is 'triptime' really of a type short? I did not look at
> sources but I would be somewhat surprised.
Nope, it's of type "long." I don't see exactly why the
conversion specifier got changed, but it looks like a pretty
harmless change--unless you end up with ping times longer than
32 seconds. In that case, the value would get truncated. Maybe
someone decided that hack would be nice to keep each output line
from exceeding 80 chars?
By the way, another option (in case you don't really feel like
using a patched netkit) is to use GNU inetutils. It doesn't
have this problem, and it's actively maintained. I'm currently
sticking with the netkit collection solely because it has a
timed daemon--but this may change soon.
--
Kelledin
"If a server crashes in a server farm and no one pings it, does
it still cost four figures to fix?"
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: Fwd: LFS'ing an alpha, continued
2002-11-13 13:06 Fwd: LFS'ing an alpha, continued Kelledin
@ 2002-11-13 18:08 ` Michal Jaegermann
0 siblings, 0 replies; 14+ messages in thread
From: Michal Jaegermann @ 2002-11-13 18:08 UTC (permalink / raw)
To: axp-list
>
> What really fixed it is probably the
> "__attribute__((aligned(sizeof(long))))" bit in the other part
> of the patch.
I did not see that "other part" in what was posted. What I quoted
was the essential part of what showed up here. The other change
in that patch was an extra blank line.
On a mailing list it is really better to put small patches
"in-line" instead of making them into attachments. This assumes,
of course, that you are not using some broken mailer which plays
games with a white space. Then change your mailer.
Peeking into ethernet packets indeed has often alignment requirements
which are different then those desired by Alpha. Forcing alignments is
usually not the answer. I do not remember when 'ping' used in Red Hat
distribution had problems for the last time. It was fixed quite a while
ago.
> The extra stuff (the whitespace, and the
> different conversion specifier) is probably just stylistic
> changes--the patch was apparently produced by a Gentoo developer
> found by google, not by me. ;)
I would have to see the whole source context but I very strongly suspect
that changing to "%hd" specifier actually introduces an error. This may
work for short turnaround times. In any case it likely would be wise
not to reinvent (badly) a wheel.
Michal
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Fwd: LFS'ing an alpha, continued
@ 2002-11-13 13:08 Kelledin
2002-11-13 14:49 ` Falk Hueffner
0 siblings, 1 reply; 14+ messages in thread
From: Kelledin @ 2002-11-13 13:08 UTC (permalink / raw)
To: axp-list
On Tuesday 12 November 2002 09:04 pm, Michal Jaegermann wrote:
> On Tue, Nov 12, 2002 at 07:24:13PM -0500, Kelledin wrote:
> > Fourth (and finally, for now), aboot-0.9a doesn't compile
> > against recent glibc versions.
>
> Which are "recent". The last time I was recompiling aboot, to
> make it look for initrd in more places then original, was
> on September 9th of this year and it definitely compiled and
> it even works. :-)
2.2.5 tripped the problem--basically a slew of unresolved
references to the glibc puts() function, which is used by the
glibc printf() function. I didn't get so far as testing it with
2.3.1, because 2.3.1 has other problems. I consider 2.3.1 to be
too experimental at this point.
> > The problem is that it tries to
> > override the printf() function, and glibc won't just go
> > along with that.
>
> This is a boot loader. You are not linking that with glibc
> but with a small static library which provides only a minimal
> required stuff. Full glibc is not available when you are
> using this.
That small static library is supposed to override glibc printf()
with its own bare-metal printf(). It doesn't, for whatever
reason--the bootloader code still tries to link with glibc's
printf(). Come to think of it, it could be gcc or binutils
that's refusing to go along with it...what versions of those
software packages are you using? I'm using (patched) gcc-3.2 and
binutils-2.13, both of which are in the stable LFS book.
Unlike the netkit patch, this patch actually came from yours
truly.
> I am not sure what you are doing but definitely something
> funny.
I just renamed aboot's internal from-scratch printf() and forced
all bootloader code to call this different function name. Thus
it doesn't have to rely on the ability to override glibc's
printf(). But as I said, it would probably break "TESTING"
mode, which is why it's only a workaround.
--
Kelledin
"If a server crashes in a server farm and no one pings it, does
it still cost four figures to fix?"
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Fwd: LFS'ing an alpha, continued
2002-11-13 13:08 Kelledin
@ 2002-11-13 14:49 ` Falk Hueffner
2002-11-13 17:09 ` Kelledin
0 siblings, 1 reply; 14+ messages in thread
From: Falk Hueffner @ 2002-11-13 14:49 UTC (permalink / raw)
To: axp-list
Kelledin <kelledin+AXP@skarpsey.dyndns.org> writes:
> On Tuesday 12 November 2002 09:04 pm, Michal Jaegermann wrote:
> > On Tue, Nov 12, 2002 at 07:24:13PM -0500, Kelledin wrote:
> > > Fourth (and finally, for now), aboot-0.9a doesn't compile
> > > against recent glibc versions.
> >
> > Which are "recent". The last time I was recompiling aboot, to
> > make it look for initrd in more places then original, was
> > on September 9th of this year and it definitely compiled and
> > it even works. :-)
>
> 2.2.5 tripped the problem--basically a slew of unresolved
> references to the glibc puts() function, which is used by the
> glibc printf() function.
Are you sure it isn't rather caused by gcc optimizing
printf("foo\n")
to
puts("foo")
?
(Yes, it really does that. Pretty clever, eh?)
--
Falk
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: Fwd: LFS'ing an alpha, continued
2002-11-13 14:49 ` Falk Hueffner
@ 2002-11-13 17:09 ` Kelledin
2002-11-13 17:41 ` Falk Hueffner
2002-11-13 17:41 ` Peter Petrakis
0 siblings, 2 replies; 14+ messages in thread
From: Kelledin @ 2002-11-13 17:09 UTC (permalink / raw)
To: axp-list
On Wednesday 13 November 2002 08:49 am, Falk Hueffner wrote:
> Kelledin <kelledin+AXP@skarpsey.dyndns.org> writes:
> > On Tuesday 12 November 2002 09:04 pm, Michal Jaegermann
wrote:
> > > On Tue, Nov 12, 2002 at 07:24:13PM -0500, Kelledin wrote:
> > > > Fourth (and finally, for now), aboot-0.9a doesn't
> > > > compile against recent glibc versions.
> > >
> > > Which are "recent". The last time I was recompiling
> > > aboot, to make it look for initrd in more places then
> > > original, was on September 9th of this year and it
> > > definitely compiled and it even works. :-)
> >
> > 2.2.5 tripped the problem--basically a slew of unresolved
> > references to the glibc puts() function, which is used by
> > the glibc printf() function.
>
> Are you sure it isn't rather caused by gcc optimizing
> printf("foo\n")
> to
> puts("foo")
> ?
>
> (Yes, it really does that. Pretty clever, eh?)
Yikes, that would do it.
Hmmm.
My next question would be, how do we keep gcc from doing that? I
assume it's some spanking-new feature in gcc3...
--
Kelledin
"If a server crashes in a server farm and no one pings it, does
it still cost four figures to fix?"
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: Fwd: LFS'ing an alpha, continued
2002-11-13 17:09 ` Kelledin
@ 2002-11-13 17:41 ` Falk Hueffner
2002-11-13 17:41 ` Peter Petrakis
1 sibling, 0 replies; 14+ messages in thread
From: Falk Hueffner @ 2002-11-13 17:41 UTC (permalink / raw)
To: axp-list
Kelledin <kelledin+AXP@skarpsey.dyndns.org> writes:
> On Wednesday 13 November 2002 08:49 am, Falk Hueffner wrote:
> > Are you sure it isn't rather caused by gcc optimizing
> > printf("foo\n")
> > to
> > puts("foo")
> > ?
> >
> > (Yes, it really does that. Pretty clever, eh?)
>
> Yikes, that would do it.
>
> My next question would be, how do we keep gcc from doing that? I
> assume it's some spanking-new feature in gcc3...
-ffreestanding. Unfortunately, that will turn off all builtin
handling, like expanding memcpy inline. One can work around that with
#define memcpy __builtin_memcpy.
Perhaps it's just easier to provide a puts, though...
--
Falk
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: Fwd: LFS'ing an alpha, continued
2002-11-13 17:09 ` Kelledin
2002-11-13 17:41 ` Falk Hueffner
@ 2002-11-13 17:41 ` Peter Petrakis
2002-11-13 18:19 ` Michal Jaegermann
1 sibling, 1 reply; 14+ messages in thread
From: Peter Petrakis @ 2002-11-13 17:41 UTC (permalink / raw)
To: axp-list
> > Are you sure it isn't rather caused by gcc optimizing
> > printf("foo\n")
> > to
> > puts("foo")
> > ?
> >
> > (Yes, it really does that. Pretty clever, eh?)
>
> Yikes, that would do it.
>
> Hmmm.
>
> My next question would be, how do we keep gcc from doing that? I
> assume it's some spanking-new feature in gcc3...
-O0 oughta do it. I don't think that's a new feature but a basic optimization.
The opt flags above tell gcc not to optimize at all. aboot doesnt need to be
any faster anyways ;)
Peter
--
www.alphadriven.org
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: Fwd: LFS'ing an alpha, continued
2002-11-13 17:41 ` Peter Petrakis
@ 2002-11-13 18:19 ` Michal Jaegermann
2002-11-13 20:57 ` George France
0 siblings, 1 reply; 14+ messages in thread
From: Michal Jaegermann @ 2002-11-13 18:19 UTC (permalink / raw)
To: axp-list
On Wed, Nov 13, 2002 at 12:41:28PM -0500, Peter Petrakis wrote:
> > > Are you sure it isn't rather caused by gcc optimizing
> > > printf("foo\n")
> > > to
> > > puts("foo")
> > > ?
> > >
> > > (Yes, it really does that. Pretty clever, eh?)
> >
> > Yikes, that would do it.
> >
> > Hmmm.
> >
> > My next question would be, how do we keep gcc from doing that? I
> > assume it's some spanking-new feature in gcc3...
>
> -O0 oughta do it.
The other way out would be to provide 'puts()' in a "private" library.
It can be trivially implemented in terms of 'printf()'. :-)
If built-ins from gcc3 are getting you instead then '-fno-builtin'
in compilation flags should solve the problem and there is always
also '-ffreestanding'. At least a "bootloader" part of the whole
package (there are other programs there as well) is really
"freestanding".
Michal
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: Fwd: LFS'ing an alpha, continued
2002-11-13 18:19 ` Michal Jaegermann
@ 2002-11-13 20:57 ` George France
0 siblings, 0 replies; 14+ messages in thread
From: George France @ 2002-11-13 20:57 UTC (permalink / raw)
To: axp-list, Michal Jaegermann; +Cc: Kelledin
hrmm, <cough>, <cough>
I believe that Will Woods (author / maintainer of aboot)
is using aboot-0.9b with gentoo and gcc 3.2. I might
just be easier to use the newer version, which has already
addressed these issues????
I hope this helps.
Best Regards,
--George
On Wednesday 13 November 2002 13:19, Michal Jaegermann wrote:
> On Wed, Nov 13, 2002 at 12:41:28PM -0500, Peter Petrakis wrote:
> > > > Are you sure it isn't rather caused by gcc optimizing
> > > > printf("foo\n")
> > > > to
> > > > puts("foo")
> > > > ?
> > > >
> > > > (Yes, it really does that. Pretty clever, eh?)
> > >
> > > Yikes, that would do it.
> > >
> > > Hmmm.
> > >
> > > My next question would be, how do we keep gcc from doing that? I
> > > assume it's some spanking-new feature in gcc3...
> >
> > -O0 oughta do it.
>
> The other way out would be to provide 'puts()' in a "private" library.
> It can be trivially implemented in terms of 'printf()'. :-)
>
> If built-ins from gcc3 are getting you instead then '-fno-builtin'
> in compilation flags should solve the problem and there is always
> also '-ffreestanding'. At least a "bootloader" part of the whole
> package (there are other programs there as well) is really
> "freestanding".
>
> Michal
>
>
>
> _______________________________________________
> Axp-list mailing list
> Axp-list@redhat.com
> https://listman.redhat.com/mailman/listinfo/axp-list
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Fwd: LFS'ing an alpha, continued
@ 2002-11-13 0:24 Kelledin
2002-11-13 3:04 ` Michal Jaegermann
0 siblings, 1 reply; 14+ messages in thread
From: Kelledin @ 2002-11-13 0:24 UTC (permalink / raw)
To: axp-list
[-- Attachment #1: Type: text/plain, Size: 992 bytes --]
On Tuesday 12 November 2002 05:15 pm, Ted Goodridge wrote:
> I'm forwarding this hoping to get some ppl with alpha
> experience as this might be a simple matter. I'm using an LFS
> system, and building Glib, but getting the following errors
> (something about pc-relative relocation) is striking me as
> odd.
Fourth (and finally, for now), aboot-0.9a doesn't compile
against recent glibc versions. The problem is that it tries to
override the printf() function, and glibc won't just go along
with that. The attached patch works around this problem, but
you probably won't be able to build aboot in "TESTING" mode
(not that you'd normally want to).
I discovered most of this over the course of the last week,
while LFS'ing my own alpha box for the first time. Who knows
what else I'll discover? I'm kind of auditing code as I go for
64-bit cleanliness.
--
Kelledin
"If a server crashes in a server farm and no one pings it, does
it still cost four figures to fix?"
[-- Attachment #2: aboot-0.9a-printf.patch.bz2 --]
[-- Type: application/x-bzip2, Size: 20489 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Fwd: LFS'ing an alpha, continued
2002-11-13 0:24 Kelledin
@ 2002-11-13 3:04 ` Michal Jaegermann
0 siblings, 0 replies; 14+ messages in thread
From: Michal Jaegermann @ 2002-11-13 3:04 UTC (permalink / raw)
To: axp-list
On Tue, Nov 12, 2002 at 07:24:13PM -0500, Kelledin wrote:
>
> Fourth (and finally, for now), aboot-0.9a doesn't compile
> against recent glibc versions.
Which are "recent". The last time I was recompiling aboot, to
make it look for initrd in more places then original, was
on September 9th of this year and it definitely compiled and
it even works. :-)
> The problem is that it tries to
> override the printf() function, and glibc won't just go along
> with that.
This is a boot loader. You are not linking that with glibc
but with a small static library which provides only a minimal
required stuff. Full glibc is not available when you are using
this.
> The attached patch works around this problem,
I am not sure what you are doing but definitely something funny.
Michal
^ permalink raw reply [flat|nested] 14+ messages in thread
* Fwd: Build Errors with GlibC on an alpha
@ 2002-11-12 23:15 Ted Goodridge
2002-11-13 0:00 ` Fwd: LFS'ing an alpha, continued Kelledin
0 siblings, 1 reply; 14+ messages in thread
From: Ted Goodridge @ 2002-11-12 23:15 UTC (permalink / raw)
To: axp-list
I'm forwarding this hoping to get some ppl with alpha experience as this might
be a simple matter. I'm using an LFS system, and building Glib, but getting
the following errors (something about pc-relative relocation) is striking me
as odd.
/static/lib/gcc-lib/alphaev56-unknown-linux-gnu/3.2/../../../../alphaev56-unk
nown-linux-gnu/bin/ld:
/static/src/fresh/lfs-packages-4.0/glibc-build/libc_pic.os: pc-relative
relocation against dynamic symbol __divlu
/static/lib/gcc-lib/alphaev56-unknown-linux-gnu/3.2/../../../../alphaev56-unk
nown-linux-gnu/bin/ld:
/static/src/fresh/lfs-packages-4.0/glibc-build/libc_pic.os: pc-relative
relocation against dynamic symbol __divqu
/static/lib/gcc-lib/alphaev56-unknown-linux-gnu/3.2/../../../../alphaev56-unk
nown-linux-gnu/bin/ld:
/static/src/fresh/lfs-packages-4.0/glibc-build/libc_pic.os: pc-relative
relocation against dynamic symbol __remlu
/static/lib/gcc-lib/alphaev56-unknown-linux-gnu/3.2/../../../../alphaev56-unk
nown-linux-gnu/bin/ld:
/static/src/fresh/lfs-packages-4.0/glibc-build/libc_pic.os: pc-relative
relocation against dynamic symbol __remqu
collect2: ld returned 1 exit status
make[1]: *** [/static/src/fresh/lfs-packages-4.0/glibc-build/libc.so] Error 1
make[1]: Leaving directory `/static/src/fresh/lfs-packages-4.0/glibc-2.2.5'
make: *** [all] Error 2
I have no name!:/static/src/fresh/lfs-packages-4.0/glibc-build#
what can I do to correct them?
-------------------------------------------------------
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Fwd: LFS'ing an alpha, continued
2002-11-12 23:15 Fwd: Build Errors with GlibC on an alpha Ted Goodridge
@ 2002-11-13 0:00 ` Kelledin
2002-11-13 2:45 ` Michal Jaegermann
2002-11-13 3:43 ` Jon
0 siblings, 2 replies; 14+ messages in thread
From: Kelledin @ 2002-11-13 0:00 UTC (permalink / raw)
To: axp-list
[-- Attachment #1: Type: text/plain, Size: 531 bytes --]
On Tuesday 12 November 2002 05:15 pm, Ted Goodridge wrote:
> I'm forwarding this hoping to get some ppl with alpha
> experience as this might be a simple matter. I'm using an LFS
> system, and building Glib, but getting the following errors
> (something about pc-relative relocation) is striking me as
> odd.
Third, netkit-base needs a patch, else the "ping" utility isn't
64-bit clean (see below).
--
Kelledin
"If a server crashes in a server farm and no one pings it, does
it still cost four figures to fix?"
[-- Attachment #2: netkit-base-0.17-alpha-ping.patch --]
[-- Type: text/x-diff, Size: 1020 bytes --]
--- netkit-base-0.17/ping/ping.c Sun Jul 23 06:16:21 2000
+++ netkit-base-0.17-alpha-ping-fix/ping/ping.c Tue Sep 10 20:14:51 2002
@@ -203,7 +203,7 @@
* datalen is the length of the other data plus the timeval.
* note: due to alignment problems don't assign to OUTPACK_TIME, use memcpy.
*/
-static u_int8_t outpack[IP_MAXPACKET];
+static u_int8_t outpack[IP_MAXPACKET] __attribute__((aligned(sizeof(long))));
static int datalen = DEFDATALEN;
#define OUTPACK_ICMP ((struct icmp *)outpack)
@@ -725,6 +725,7 @@
tp = (struct timeval *)icp->icmp_data;
memcpy(&packettv, tp, sizeof(struct timeval));
tvsub(&now, &packettv);
+
/* precision: tenths of milliseconds */
triptime = now.tv_sec * 10000 + (now.tv_usec / 100);
@@ -760,7 +761,7 @@
inet_ntoa(from->sin_addr), icp->icmp_seq);
printf(" ttl=%d", ip->ip_ttl);
if (timing) {
- printf(" time=%ld.%ld ms", triptime/10,
+ printf(" time=%hd.%hd ms", triptime/10,
triptime%10);
}
if (dupflag) {
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: Fwd: LFS'ing an alpha, continued
2002-11-13 0:00 ` Fwd: LFS'ing an alpha, continued Kelledin
@ 2002-11-13 2:45 ` Michal Jaegermann
2002-11-13 3:43 ` Jon
1 sibling, 0 replies; 14+ messages in thread
From: Michal Jaegermann @ 2002-11-13 2:45 UTC (permalink / raw)
To: axp-list
On Tue, Nov 12, 2002 at 07:00:41PM -0500, Kelledin wrote:
>
> Third, netkit-base needs a patch, else the "ping" utility isn't
> 64-bit clean (see below).
> - printf(" time=%ld.%ld ms", triptime/10,
> + printf(" time=%hd.%hd ms", triptime/10,
Eh??? You switched a long conversion flag for an integer specifier in
printf() to short to make 'ping' 64-bit clean? Whatever you think this
does it is not doing anything overly useful.
Is 'triptime' really of a type short? I did not look at sources but I
would be somewhat surprised.
Michal
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: Fwd: LFS'ing an alpha, continued
2002-11-13 0:00 ` Fwd: LFS'ing an alpha, continued Kelledin
2002-11-13 2:45 ` Michal Jaegermann
@ 2002-11-13 3:43 ` Jon
1 sibling, 0 replies; 14+ messages in thread
From: Jon @ 2002-11-13 3:43 UTC (permalink / raw)
To: axp-list, Kelledin
To the List:
There is a new guy who has some ideas, hey? They may be good ideas or they
may not, time will tell. I'm glad to see it, because there are few enough
people willing to put in time on Alpha software.
My thought is, how about welcoming the guy, thanking him for his efforts and
helping him out a little, even. Or maybe it's a her? What the hell! If
three guys got sick or fell of their bicycles hard, there wouldn't be much
Alpha Linux at all.
Just a thought ...
jn
"Thursday"
On Tuesday 12 November 2002 05:00 pm, Kelledin wrote:
> On Tuesday 12 November 2002 05:15 pm, Ted Goodridge wrote:
> > I'm forwarding this hoping to get some ppl with alpha
> > experience as this might be a simple matter. I'm using an LFS
> > system, and building Glib, but getting the following errors
> > (something about pc-relative relocation) is striking me as
> > odd.
>
> Third, netkit-base needs a patch, else the "ping" utility isn't
> 64-bit clean (see below).
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2002-11-13 20:57 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-13 13:06 Fwd: LFS'ing an alpha, continued Kelledin
2002-11-13 18:08 ` Michal Jaegermann
-- strict thread matches above, loose matches on Subject: below --
2002-11-13 13:08 Kelledin
2002-11-13 14:49 ` Falk Hueffner
2002-11-13 17:09 ` Kelledin
2002-11-13 17:41 ` Falk Hueffner
2002-11-13 17:41 ` Peter Petrakis
2002-11-13 18:19 ` Michal Jaegermann
2002-11-13 20:57 ` George France
2002-11-13 0:24 Kelledin
2002-11-13 3:04 ` Michal Jaegermann
2002-11-12 23:15 Fwd: Build Errors with GlibC on an alpha Ted Goodridge
2002-11-13 0:00 ` Fwd: LFS'ing an alpha, continued Kelledin
2002-11-13 2:45 ` Michal Jaegermann
2002-11-13 3:43 ` Jon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox