BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000370 [uClibc] Architecture Specific major always 08-08-05 10:57 09-25-05 10:36
Reporter jswensen View Status public  
Assigned To uClibc
Priority normal Resolution fixed  
Status closed   Product Version 0.9.27
Summary 0000370: Build fails due to symbol aliasing on undefined symbol - 'adjtimex'
Description I saw this mentioned in another bug report, but they posted it as a note after the bug was closed, so I thought I would try wake it up by posting it as its own bug.

We are trying to build a toolchain for PowerPC under cygwin and get this adjtimex error. We are using the GCC 4.0.1 compiler generated by buildroot

Additional Information Output
-------
/dsrc/buildroot/build_powerpc/staging_dir/bin/powerpc-linux-uclibc-gcc -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-builtin -nostdinc -D_LIBC -I../../../../include -I. -Os -funit-at-a-time -isystem /dsrc/buildroot/build_powerpc/staging_dir/lib/gcc/powerpc-linux-uclibc/4.0.1/include -DNDEBUG -fpic -c adjtimex.c -o adjtimex.o
adjtimex.c:14: error: '__adjtimex' aliased to undefined symbol 'adjtimex'
adjtimex.c:15: error: 'ntp_adjtime' aliased to undefined symbol 'adjtimex'
make[5]: *** [adjtimex.o] Error 1
Attached Files  uclibc-ppc-ioctl-errno.patch [^] (705 bytes) 08-26-05 00:06
 uclibc-ppc-syscall.patch [^] (4,643 bytes) 08-26-05 00:07
 uclibc-ppc-uint128.patch [^] (806 bytes) 08-26-05 00:07
 uclibc-syscallerror.patch [^] (598 bytes) 09-19-05 04:56

- Relationships

- Notes
(0000396)
jswensen
08-08-05 15:48

FYI, I just tried building the toolchain with the same buildroot config under Linux and the same error occurs.
 
(0000428)
asierllano
08-22-05 00:18

This problem is gcc-4 specific because I have the same problem with gcc-4.0.0 & gcc-4.0.1, while I successfully build with gcc-3.3 & gcc-3.4.

The problem must be related to weak references, because if you comment the lines of the previous error, the same error seems to happen in every weak reference of the code.

The same problem still remains in version 0.9.28.

(Maybe the summary should be updated to show that the problem is related to:
gcc-4 + weak references).
(Maybe the version should updated to 0.9.28)
 
(0000436)
asierllano
08-26-05 00:06

I've managed to build the latest version of uclibc with gcc-4.0.1.
I've developed serveral patches that I explain here:

uclibc-ppc-syscall.patch:
-------------------------
This patch modifies the syscall code for the powerpc, and leaves it like it was previosly (older version of the uclibc repository). It uses the syscall code from the kernel.
This way it compiles properly with gcc-4. The problem was that the previous code defined the functions in assembly code, so that the compiler didn't think the functions had a definition so that the next weak aliases to those functions didn't work because they were not defined.
(Previous version of gcc compilers work when definin weak aliases to undefined functions).
Maybe the syscall code could be reworked again, but meanwhile I left with the kernel default syscall code, that was the original aproach of uclibc.

uclibc-ppc-ioctl-errno.patch
----------------------------
This patch solves easily an error in the ioctl code for the PPC because it uses the "errno" variable without including "errno.h".

uclibc-ppc-uint128.patch
------------------------
The gcc compiler has deprecated the type __uint128 for 32-bits platforms. Due to the fact that this type was introduced in gcc-3.1 it is better to drop its use. (glibc has the same problem and uses this same solution).
 
(0000440)
jocke
08-27-05 03:59

uclibc-ppc-syscall.patch:
This can't go in as is. Can you complete this patch?
Does this add to the total size of uClibc?
Maybe unified_syscall_body can be reworked instead?

uclibc-ppc-ioctl-errno.patch:
Can't find any use of errno in that file. Can you elaborate?

uclibc-ppc-uint128.patch:
Looks ok to me. Will commit.
 
(0000468)
asierllano
08-28-05 13:39

uclibc-ppc-syscall.patch:
-----------------------------
What I did was reverting the file
libc/sysdeps/linux/powerpc/bits/syscalls.h
to revision 5453.
Have a look at:
http://www.uclibc.org/cgi-bin/viewcvs.cgi/trunk/uClibc/libc/sysdeps/linux/powerpc/bits/syscalls.h?rev=5453&view=markup [^]
After that revision, the syscalls where done fully in assembly (without a valid C definition) so that gcc-4 cannot make weak aliases to an undefined function.
I don't know too much about assembly language so the only thing I could do was use again the old code that uses the syscalls from the linux kernel.
Maybe someone like you (jocke) will be able to take another aproach. I analized which one was the problem, but I don't know enough assembly to solve it in a better way.

uclibc-ppc-ioctl-errno.patch:
-----------------------------
I included this patch because errno was used in the syscall of (I'm not sure now, but I can have a look about it tomorrow) and I needed to include the header. We can think about this patch after the previous one because I think that it is somehow related.

Like I told to you, I'm not a good assembly programmer, but I can be a good tester.

Thank you for your time.
 
(0000543)
jocke
09-17-05 05:11

I have imported the syscall defs from glibc. Try if current SVN works
now.


The uclibc-ppc-ioctl-errno.patch has been ignored for now. Please bring it up again if you need it and why.
 
(0000552)
asierllano
09-19-05 04:55

I've obtained the following error while compiling:

make[2]: Entering directory `/home/asier/uSEL/branch-tmp/trunk/output/board-lite5200/toolchain/uClibc-0.9.28/librt'
/home/asier/uSEL/branch-tmp/trunk/output/board-lite5200/stage/bin/powerpc-linux-uclibc-ld -shared --warn-common --warn-once -z combreloc -z defs -s -soname=librt.so.0 \
-o librt-0.9.28.so --whole-archive librt.a \
--no-whole-archive ../libc/misc/internals/interp.o \
-L../lib -lc /home/asier/uSEL/branch-tmp/trunk/output/board-lite5200/stage/lib/gcc/powerpc-linux-uclibc/4.0.1/libgcc.a;
librt.a(mq_open.o): In function `mq_open':
mq_open.c:(.text+0xc8): undefined reference to `__syscall_error'
make[2]: *** [shared] Error 1
make[2]: Leaving directory `/home/asier/uSEL/branch-tmp/trunk/output/board-lite5200/toolchain/uClibc-0.9.28/librt'

I've managed to fix it (I don't know if it is the best way).
The problem is raised because __syscall_error is a hiden function in libuClibc. The problem is that it is used for every syscall (after the last commit you've done) so librt needs it.

The way I've fixed:
uclibc-syscallerror.patch
 
(0000559)
jocke
09-19-05 05:56

hmm, __syscall_error is supposed to be hidden because it is
internal to uClibc. Need to think a bit on what to do.
 
(0000563)
jocke
09-20-05 14:20

svn up and try again, thanks
 
(0000577)
jocke
09-25-05 10:36

No complaints since last fix, so I will close this one now.
 

- Issue History
Date Modified Username Field Change
08-08-05 10:57 jswensen New Issue
08-08-05 10:57 jswensen Status new => assigned
08-08-05 10:57 jswensen Assigned To  => uClibc
08-08-05 15:48 jswensen Note Added: 0000396
08-19-05 04:59 asierllano Issue Monitored: asierllano
08-22-05 00:18 asierllano Note Added: 0000428
08-26-05 00:06 asierllano Note Added: 0000436
08-26-05 00:06 asierllano File Added: uclibc-ppc-ioctl-errno.patch
08-26-05 00:07 asierllano File Added: uclibc-ppc-syscall.patch
08-26-05 00:07 asierllano File Added: uclibc-ppc-uint128.patch
08-27-05 03:59 jocke Note Added: 0000440
08-28-05 13:39 asierllano Note Added: 0000468
09-17-05 05:11 jocke Note Added: 0000543
09-19-05 04:55 asierllano Note Added: 0000552
09-19-05 04:56 asierllano File Added: uclibc-syscallerror.patch
09-19-05 05:56 jocke Note Added: 0000559
09-20-05 14:20 jocke Note Added: 0000563
09-25-05 10:36 jocke Status assigned => closed
09-25-05 10:36 jocke Note Added: 0000577
09-25-05 10:36 jocke Resolution open => fixed


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker