Bug 2671 - On powerpc the order of parameters in weak_alias is significant
Summary: On powerpc the order of parameters in weak_alias is significant
Status: RESOLVED INVALID
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.4
: P2 normal
Target Milestone: ---
Assignee: Ulrich Drepper
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-17 17:12 UTC by Rainer Malitzke Goes
Modified: 2019-04-10 08:18 UTC (History)
1 user (show)

See Also:
Host: powerpc-linux-gnu
Target: powerpc-linux-gnu
Build: powerpc-linux-gnu
Last reconfirmed:
fweimer: security-


Attachments
Fix weak_alias usage in socket code. (323 bytes, patch)
2006-05-18 14:57 UTC, Dwayne Grant McConnell
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rainer Malitzke Goes 2006-05-17 17:12:48 UTC
The unmodified weak_alias, as shown the the weak_alias.diff patch shown below
gives compilation errors on current snapshot and CVS 2.3.6 and 2.4 glibc. The
unmodifed _equivalent_ forms on i[3456]x86 work fine.


-weak_alias (getsockname, __getsockname)
+weak_alias (__getsockname, getsockname)


The modification was tested on both glibc 2.3.6 and 2.4 snapshots over several
weeks now.

The compilations were attempted with current gcc-4.2.0 and current snapshot
binutils.

The exist a more severe problem farther down in the powerpc glibc compilation
subject of a forthcoming PR.
Comment 1 Rainer Malitzke Goes 2006-05-17 17:26:32 UTC
Ulrich!
I am at a loss. The patch I have as diff -U worked fine on the actual tree.
However I can not get accepted by bugzilla either in the comments part or in
an attachement. I am going to try and edit it to if a form is acceptable.
Comment 2 Dwayne Grant McConnell 2006-05-17 18:01:25 UTC
When you say "can not get accepted by bugzilla" do you mean when you try to put
it in as a comment or as an attachment? What error are you having? 
Comment 3 Rainer Malitzke Goes 2006-05-17 18:13:36 UTC
  My mozilla is kept indefinetely "waiting for sources.red.hat.com"
  When I take the patch text out it works fine. 
Comment 4 Rainer Malitzke Goes 2006-05-17 18:18:06 UTC
 In both cases (attachment or comment) I click on commit and it hangs as long as
I have diff output build messages for you.
Comment 5 Dwayne Grant McConnell 2006-05-17 18:30:38 UTC
mail the patch to me and I'll take a look - very curious - what version of mozilla?
Comment 6 Rainer Malitzke Goes 2006-05-18 02:28:35 UTC
Well, another attempt

>   --- ./sysdeps/unix/sysv/linux/getsockname.S.org	2002-05-14
20:17:58.000000000 -0400
>   +++ ./sysdeps/unix/sysv/linux/getsockname.S	2006-05-08 05:34:59.000000000 -0400
>   @@ -2,4 +2,4 @@
>    #define	NARGS	3
>    #define NO_WEAK_ALIAS	1
>    #include <socket.S>
>   -weak_alias (getsockname, __getsockname)
>   +weak_alias (__getsockname, getsockname)
>   --- ./sysdeps/unix/sysv/linux/bind.S.org	2002-05-14 20:17:25.000000000 -0400
>   +++ ./sysdeps/unix/sysv/linux/bind.S	2006-05-08 05:21:20.000000000 -0400
>   @@ -2,4 +2,4 @@
>    #define	NARGS	3
>    #define NO_WEAK_ALIAS	1
>    #include <socket.S>
>   -weak_alias (bind, __bind)
>   +weak_alias ( __bind, bind)
>   --- ./sysdeps/unix/sysv/linux/listen.S.org	2002-05-14 20:18:37.000000000 -0400
>   +++ ./sysdeps/unix/sysv/linux/listen.S	2006-05-08 05:37:40.000000000 -0400
>   @@ -2,4 +2,4 @@
>    #define	NARGS	2
>    #define NO_WEAK_ALIAS	1
>    #include <socket.S>
>   -weak_alias (listen, __listen)
>   +weak_alias (__listen, listen)
>   --- ./sysdeps/unix/sysv/linux/setsockopt.S.org	2002-05-14 20:19:09.000000000
-0400
>   +++ ./sysdeps/unix/sysv/linux/setsockopt.S	2006-05-08 05:40:46.000000000 -0400
>   @@ -2,4 +2,4 @@
>    #define	NARGS	5
>    #define NO_WEAK_ALIAS	1
>    #include <socket.S>
>   -weak_alias (setsockopt, __setsockopt)
>   +weak_alias (__setsockopt, setsockopt)
Comment 7 Dwayne Grant McConnell 2006-05-18 14:56:50 UTC
--- ./sysdeps/unix/sysv/linux/getsockname.S.org 2002-05-14
20:17:58.000000000 -0400
+++ ./sysdeps/unix/sysv/linux/getsockname.S     2006-05-08 05:34:59.000000000 -0400
@@ -2,4 +2,4 @@
 #define        NARGS   3
 #define NO_WEAK_ALIAS  1
 #include <socket.S>
-weak_alias (getsockname, __getsockname)
+weak_alias (__getsockname, getsockname)
--- ./sysdeps/unix/sysv/linux/bind.S.org        2002-05-14 20:17:25.000000000 -0400
+++ ./sysdeps/unix/sysv/linux/bind.S    2006-05-08 05:21:20.000000000 -0400
@@ -2,4 +2,4 @@
 #define        NARGS   3
 #define NO_WEAK_ALIAS  1
 #include <socket.S>
-weak_alias (bind, __bind)
+weak_alias (__bind, bind)
--- ./sysdeps/unix/sysv/linux/listen.S.org      2002-05-14 20:18:37.000000000 -0400
+++ ./sysdeps/unix/sysv/linux/listen.S  2006-05-08 05:37:40.000000000 -0400
@@ -2,4 +2,4 @@
 #define        NARGS   2
 #define NO_WEAK_ALIAS  1
 #include <socket.S>
-weak_alias (listen, __listen)
+weak_alias (__listen, listen)
--- ./sysdeps/unix/sysv/linux/setsockopt.S.org  2002-05-14 20:19:09.000000000
-0400
+++ ./sysdeps/unix/sysv/linux/setsockopt.S      2006-05-08 05:40:46.000000000 -0400
@@ -2,4 +2,4 @@
 #define        NARGS   5
 #define NO_WEAK_ALIAS  1
 #include <socket.S>
-weak_alias (setsockopt, __setsockopt)
+weak_alias (__setsockopt, setsockopt)
Comment 8 Dwayne Grant McConnell 2006-05-18 14:57:48 UTC
Created attachment 1033 [details]
Fix weak_alias usage in socket code.
Comment 9 Dwayne Grant McConnell 2006-05-18 15:00:20 UTC
For future reference it is not very helpful to put a patch in that the patch
program cannot process unmodified. Additionally you had extra spaces in front of
__bind in the line

+weak_alias ( __bind, bind)

I was able to edit your patch and both insert it into a comment and attach it
without problem. I suggest you resolve the problem on your end before you
attempt  to submit other patches.

Do you have any testcase beyond the build issues you saw?
Comment 10 Rainer Malitzke Goes 2006-05-19 22:00:11 UTC
Well, after rebuilding most of X11R6 and reinstalling mozilla (2.7.12) that
problem, apparently, misinterpretation of some character went away.

Going back to the weak_alias issue. Now, after CVS updates to glibc, svn updates
to gcc-4.2 (main trunk) and rebuilt binutils the order of the parameters has
become irrelevant. I always thought it was really a gcc issue but after hand
editing the four *.S by hand I thought it would be helpful to the glibc
community to have a little patch.

Again, it might be only of temporary interest to know that it is necessary to
change VERSION=0605xx in the binutils bfd, gas, and gprof configure files to
something like =2.17.  Otherwise, the configuration of glibc will term ld and as
as being too old.

Finally in reading the equivalents to PR 333 (my PR 2672 was made equivalent to
333) I see that similarily to the gcc in-crowd, people from the user community
are not really wellcome. At over 70 years, but as a former assembly language
real-time systems programmer I can take a hint and will restrict myself to cases
like ICE and segmentation errors. That issue in PR 2672 will either fade away or
I will find a way to fake it out and continue building my own libcs, as I have
been doing for a long time. I started with gcc-1.4.x and the Berkeley libraries;
hacking both for use on SCO's Xenix.
Comment 11 Ulrich Drepper 2006-09-09 17:23:18 UTC
If this patch is necessary then it's the ppc definition of socket.S which is
wrong.  The x86 version is the master copy, see how it handles symbols.