DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2010-03-31 00:08:52

jcard
Member
From: Portugal
Registered: 2008-09-21
Posts: 289

The optware dns323 seed does not work with Alt-F

Can anybody give an hint on this subject?

Must be a compilation compatibility problem.
I'm using gcc-4.3.3 and uclibc-0.9.30.3 with eabi and soft-float.

After cross-compiling ipkg from source and installing :

# ipkg --version
ipkg version 0.99.163
# ipkg install cal
#gcal
gcal: can't resolve symbol '__register_frame_info'
# tic
tic: can't resolve symbol '__stdout'
# ldd /opt/bin/gcal
        libm.so.0 => /lib/libm.so.0 (0x4000d000)
        libncurses.so.5 => /opt/lib/libncurses.so.5 (0x40027000)
        libc.so.0 => /lib/libc.so.0 (0x4006e000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x400cc000)
        ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x40000000)

This happens with several executables.

Thanks

jcard@silver:~/Alt-F/build2> build_arm/staging_dir/usr/bin/arm-linux-gcc -v
Using built-in specs.                                                     
Target: arm-linux-uclibcgnueabi                                           
Configured with: /home/jcard/Alt-F/build2/toolchain_build_arm/gcc-4.3.3/configure --prefix=/usr --build=i386-pc-linux-gnu --host=i386-pc-linux-gnu --target=arm-linux-uclibcgnueabi --enable-languages=c,c++ --with-sysroot=/home/jcard/Alt-F/build2/build_arm/staging_dir --with-build-time-tools=/home/jcard/Alt-F/build2/build_arm/staging_dir/usr/arm-linux-uclibcgnueabi/bin --disable-__cxa_atexit --enable-target-optspace --with-gnu-ld --disable-libssp --disable-tls --enable-shared --with-gmp=/home/jcard/Alt-F/build2/toolchain_build_arm/gmp --with-mpfr=/home/jcard/Alt-F/build2/toolchain_build_arm/mpfr --disable-nls --enable-threads --disable-multilib --disable-decimal-float --with-float=soft --with-abi=aapcs-linux --with-arch=armv5te --with-tune=arm9tdmi : (reconfigured) /home/jcard/Alt-F/build2/toolchain_build_arm/gcc-4.3.3/configure --prefix=/usr --build=i386-pc-linux-gnu --host=i386-pc-linux-gnu --target=arm-linux-uclibcgnueabi --enable-languages=c,c++ --with-sysroot=/home/jcard/Alt-F/build2/build_arm/staging_dir --with-build-time-tools=/home/jcard/Alt-F/build2/build_arm/staging_dir/usr/arm-linux-uclibcgnueabi/bin --disable-__cxa_atexit --enable-target-optspace --with-gnu-ld --disable-libssp --disable-tls --enable-shared --with-gmp=/home/jcard/Alt-F/build2/toolchain_build_arm/gmp --with-mpfr=/home/jcard/Alt-F/build2/toolchain_build_arm/mpfr --disable-nls --enable-threads --disable-multilib --disable-decimal-float --with-float=soft --with-abi=aapcs-linux --with-arch=armv5te --with-tune=arm9tdmi : (reconfigured) /home/jcard/Alt-F/build2/toolchain_build_arm/gcc-4.3.3/configure --prefix=/usr --build=i386-pc-linux-gnu --host=i386-pc-linux-gnu --target=arm-linux-uclibcgnueabi --enable-languages=c,c++ --with-sysroot=/home/jcard/Alt-F/build2/build_arm/staging_dir --with-build-time-tools=/home/jcard/Alt-F/build2/build_arm/staging_dir/usr/arm-linux-uclibcgnueabi/bin --disable-__cxa_atexit --enable-target-optspace --with-gnu-ld --disable-libssp --disable-tls --enable-shared --with-gmp=/home/jcard/Alt-F/build2/toolchain_build_arm/gmp --with-mpfr=/home/jcard/Alt-F/build2/toolchain_build_arm/mpfr --disable-nls --enable-threads --disable-multilib --disable-decimal-float --with-float=soft --with-abi=aapcs-linux --with-arch=armv5te --with-tune=arm9tdmi : (reconfigured) /home/jcard/Alt-F/build2/toolchain_build_arm/gcc-4.3.3/configure --prefix=/usr --build=i386-pc-linux-gnu --host=i386-pc-linux-gnu --target=arm-linux-uclibcgnueabi --enable-languages=c,c++ --with-sysroot=/home/jcard/Alt-F/build2/build_arm/staging_dir --with-build-time-tools=/home/jcard/Alt-F/build2/build_arm/staging_dir/usr/arm-linux-uclibcgnueabi/bin --disable-__cxa_atexit --enable-target-optspace --with-gnu-ld --disable-libssp --disable-tls --enable-shared --with-gmp=/home/jcard/Alt-F/build2/toolchain_build_arm/gmp --with-mpfr=/home/jcard/Alt-F/build2/toolchain_build_arm/mpfr --disable-nls --enable-threads --disable-multilib --disable-decimal-float --with-float=soft --with-abi=aapcs-linux --with-arch=armv5te --with-tune=arm9tdmi : (reconfigured) /home/jcard/Alt-F/build2/toolchain_build_arm/gcc-4.3.3/configure --prefix=/usr --build=i386-pc-linux-gnu --host=i386-pc-linux-gnu --target=arm-linux-uclibcgnueabi --enable-languages=c,c++ --with-sysroot=/home/jcard/Alt-F/build2/build_arm/staging_dir --with-build-time-tools=/home/jcard/Alt-F/build2/build_arm/staging_dir/usr/arm-linux-uclibcgnueabi/bin --disable-__cxa_atexit --enable-target-optspace --with-gnu-ld --disable-libssp --disable-tls --enable-shared --with-gmp=/home/jcard/Alt-F/build2/toolchain_build_arm/gmp --with-mpfr=/home/jcard/Alt-F/build2/toolchain_build_arm/mpfr --disable-nls --enable-threads --disable-multilib --disable-decimal-float --with-float=soft --with-abi=aapcs-linux --with-arch=armv5te --with-tune=arm9tdmi : (reconfigured) /home/jcard/Alt-F/build2/toolchain_build_arm/gcc-4.3.3/configure --prefix=/usr --build=i386-pc-linux-gnu --host=i386-pc-linux-gnu --target=arm-linux-uclibcgnueabi --enable-languages=c,c++ --with-sysroot=/home/jcard/Alt-F/build2/build_arm/staging_dir --with-build-time-tools=/home/jcard/Alt-F/build2/build_arm/staging_dir/usr/arm-linux-uclibcgnueabi/bin --disable-__cxa_atexit --enable-target-optspace --with-gnu-ld --disable-libssp --disable-tls --enable-shared --with-gmp=/home/jcard/Alt-F/build2/toolchain_build_arm/gmp --with-mpfr=/home/jcard/Alt-F/build2/toolchain_build_arm/mpfr --disable-nls --enable-threads --disable-multilib --disable-decimal-float --with-float=soft --with-abi=aapcs-linux --with-arch=armv5te --with-tune=arm9tdmi
Thread model: posix
gcc version 4.3.3 (GCC)


Please consider discussing Alt-F at http://groups.google.com/group/alt-f/topics
Please consider filling Alt-F bugs at http://code.google.com/p/alt-f/issues/list

Offline

 

#2 2010-03-31 10:26:01

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: The optware dns323 seed does not work with Alt-F

Not sure if that's the problem, but use of --disable-__cxa_atexit looks unusual. Afaict, this switch is related to C++ and exception handling, just like __register_frame_info.

PS: You should use EABI packages.

Offline

 

#3 2010-04-01 05:23:03

jcard
Member
From: Portugal
Registered: 2008-09-21
Posts: 289

Re: The optware dns323 seed does not work with Alt-F

fonz wrote:

Not sure if that's the problem, but use of --disable-__cxa_atexit looks unusual. Afaict, this switch is related to C++ and exception handling, just like __register_frame_info.

The only thing I know is that is related with "weak symbol" resolution. Using ffp objdump:

Code:

from Alt-F
# objdump -T /usr/bin/ntpd  | grep frame_info
00000000  w   D  *UND*  00000000 __deregister_frame_info
00000000  w   D  *UND*  00000000 __register_frame_info

from Optware
# objdump -T /opt/bin/gcal | grep frame_info
00000000  w   DF *UND*  0000000c  GLIBC_2.0   __register_frame_info
00000000  w   DF *UND*  00000004  GLIBC_2.0   __deregister_frame_info

from ffp
# objdump -T /ffp/bin/nm  | grep frame_info
<none>

this is from nm man:
         "W" The  symbol  is  a  weak  symbol that has not been specifically
               tagged as a weak object symbol.  When a weak defined symbol  is
               linked  with a normal defined symbol, the normal defined symbol
               is used with no error.  When a weak undefined symbol is  linked
               and  the  symbol  is  not  defined,  the value of the symbol is
               determined in a system-specific manner without error.  On  some
               systems,  uppercase  indicates  that  a  default value has been
               specified.

but no symbols, so from objdump man:
    "w" The symbol is weak (w) or strong (a space).
    "F"  The symbol is the name of a function (F)
    "D" The symbol is a dynamic symbol

I can't find those symbols defined in any Alt-F library, but even so the executables run OK (as *frame_info is data, but if not used and as is "weak", no problem arises)
Optware expects *_frame_info to be a function. In that case it fails even being "weak"...

I will have to investigate further, after a short Easter hollidays.

PS: You should use EABI packages.

I'm afraid I don't understand what you mean, "EABI packages"? Optware has two kind of packages for the dns323? I followed "our" wiki to get the feed...

I'm definitevely using EABI on Alt-F (http://wiki.debian.org/ArmEabiPort).
There are some differences between mine, yours and Optware executables in this respect. (I don't have a math emulator built in the kernel)

Code:

Alt-F executable

# readelf -h  /usr/bin/ntpd | grep Flags
  Flags:                             0x4000002, has entry point, Version4 EABI
# file /usr/bin/ntpd
/usr/bin/ntpd: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), stripped
# objdump -x /usr/bin/ntpd | grep 'private flags'
private flags = 4000002: [Version4 EABI] [has entry point]

Optware executable

# readelf -h /opt/bin/gcal | grep Flags
  Flags:                             0x2, has entry point, GNU EABI
# file /opt/bin/gcal
/opt/bin/gcal: ELF 32-bit LSB executable, ARM, version 1, dynamically linked (uses shared libs), stripped
# objdump -x /opt/bin/gcal | grep 'private flags'
private flags = 2: [APCS-32] [FPA float format] [has entry point]

ffp executable

# readelf -h /ffp/bin/nm | grep Flags
  Flags:                             0x202, has entry point, GNU EABI, software FP
# file /ffp/bin/nm
/ffp/bin/nm: ELF 32-bit LSB executable, ARM, version 1, dynamically linked (uses shared libs), stripped
# objdump -x /ffp/bin/nm | grep 'private flags'
private flags = 202: [APCS-32] [FPA float format] [software FP] [has entry point]

Thanks


Please consider discussing Alt-F at http://groups.google.com/group/alt-f/topics
Please consider filling Alt-F bugs at http://code.google.com/p/alt-f/issues/list

Offline

 

#4 2010-04-01 10:19:34

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: The optware dns323 seed does not work with Alt-F

jcard wrote:

I can't find those symbols defined in any Alt-F library

Of course, not. Calls to __register_frame_info et al are generated by the compiler. Your Alt-F binaries are created using a compiler that does not support/use __register_frame_info (but dns323 optware uses a differently configured compiler).

PS: You should use EABI packages.

The dns323 optware packages are compiled to work with the stock firmware, which is OABI. Your Alt-F uses EABI, so you should look out for optware packages that are compiled for the same/similar enough processor, but for use with EABI kernel and libraries.

Offline

 

#5 2010-04-01 19:36:26

jcard
Member
From: Portugal
Registered: 2008-09-21
Posts: 289

Re: The optware dns323 seed does not work with Alt-F

fonz wrote:

jcard wrote:

I can't find those symbols defined in any Alt-F library

Of course, not. Calls to __register_frame_info et al are generated by the compiler. Your Alt-F binaries are created using a compiler that does not support/use __register_frame_info (but dns323 optware uses a differently configured compiler).

Perhaps my usage of "in any Alt-F library" was misleading, I meant libgcc_s to be one of those.

All Alt-F binaries have __register_frame_info undefined, so as it was compiler/toolchain generated I would expect those to be defined in either libgcc_s, ld-uClibc or libuClibc, but that is not the case.

That is was happens with other internal weak symbols (not sure if all)

But this academic. NSLUG-2 Optware feeds seems to be out of question (hmm, even if I distribute the original firmware libraries? no rpath... no, I don't think so, the loader must have different requirements... but there are no undefined symbols in it... and the kernel supports OABI...)

PS: You should use EABI packages.

The dns323 optware packages are compiled to work with the stock firmware, which is OABI. Your Alt-F uses EABI, so you should look out for optware packages that are compiled for the same/similar enough processor, but for use with EABI kernel and libraries.

OK, now I understand what you mean. Addressed above.

Thanks


Please consider discussing Alt-F at http://groups.google.com/group/alt-f/topics
Please consider filling Alt-F bugs at http://code.google.com/p/alt-f/issues/list

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB