[uClibc] BusyBox: Strange dynamic linking behaviour

okorpil at fh-landshut.de okorpil at fh-landshut.de
Wed Apr 21 08:08:49 UTC 2004


Hi,

I am doing a Linux evaluation on a Motorola MVME2100 board, featuring a
MPC8240 Microcontroller (PowerPC 603e with MPC107 bridge).

When I link BusyBox dynamically with glibc 2.2.5 (gcc 2.95.3) it works
fine. When I link it statically with uClibc 0.9.26 (gcc 3.3.3 toolchain
from this site), it works fine.

But if I link dynamically with uClibc 0.9.26, string functions seem to
have problems: The init process starts, 2 blank lines get put out (no
BusyBox initial banner is printed), and the login prompt appears, but no
other key than Enter works, nothing is echoed to screen, and logging in
doesn't work.

Since this only happens when dynamically linking, I thought here would be
the best place to seek some support/information.

I've read in the archives, that uClibc actually had linking problems on
ppc, with segfaults, but I looked into the file named, and found the patch
for that problem applied (the "r0" register clobber in a "addi").

I've also found in the archives that there might be some deeper, subtle
issues with the current releases on powerpc, so maybe there is no solution
for this problem yet, and I'd be happy to know I simply have to rely on
static linking.

But if it's my own lack of experience, I'd really like to do better than
simply link statically, so if someone knows a solution, I'd be happy to
know it.

(I have some 4 MB of flash for a initial ram disk, so I'd be happy if I
find  a solution that safes as much "disk space" as possible in the long
run...)

Oh, and I have a separate uClibc compiled for copying onto the target,
additionally to the toolchain. Is this wrong?

Please let me know if I can supply any further information that would be
helpful!

Thanks in advance!
Oliver Korpilla

Here the configurable section of the toolchain Makefile:

# What sortof target system shall we compile this for?
#ARCH:=i386
#ARCH:=arm
#ARCH:=mips
#ARCH:=mipsel
ARCH:=powerpc
#ARCH:=sh4
#ARCH:=cris
#ARCH:=sh64
#ARCH:=m68k
#ARCH:=v850
#ARCH:=sparc
#ARCH:=whatever

# Enable this to use the uClibc daily snapshot instead of a released
# version.  Daily snapshots may contain new features and bugfixes. Or
# they may not even compile at all, depending on what Erik is doing...
USE_UCLIBC_SNAPSHOT:=false

# Enable large file (files > 2 GB) support
BUILD_WITH_LARGEFILE:=true

# Command used to download source code
WGET:=wget --passive-ftp

# Optimize toolchain for which type of CPU?
OPTIMIZE_FOR_CPU=$(ARCH)
#OPTIMIZE_FOR_CPU=i686
#OPTIMIZE_FOR_CPU=i586
#OPTIMIZE_FOR_CPU=whatever

# Soft floating point options.
# Notes:
#   Currently builds with gcc 3.3 for arm, mips, mipsel, powerpc.
#   (i386 support will be added back in at some point.)
#   Only tested with multilib enabled.
#   For i386, long double is the same as double (64 bits).  While this
#      is unusual for x86, it seemed the best approach considering the
#      limitations in the gcc floating point emulation library.
#   For arm, soft float uses the usual libfloat routines.
#   Custom specs files are used to set the default gcc mode to soft float
#      as a convenience, since you shouldn't link hard and soft float
#      together.  In fact, arm won't even let you.
# (Un)comment the appropriate line below.
SOFT_FLOAT:=false

TARGET_OPTIMIZATION=-Os
TARGET_DEBUGGING= #-g


# Any additional gcc options you may want to include....
EXTRA_GCC_CONFIG_OPTIONS:=

# Enable the following if you want locale/gettext/i18n support.
# NOTE!  Currently the pregnerated locale stuff only works for x86!
ENABLE_LOCALE:=false

# If you want multilib enabled, enable this...
MULTILIB:=--enable-multilib

# Build/install c++ compiler and libstdc++?
INSTALL_LIBSTDCPP:=true

# Build/install java compiler and libgcj? (requires c++)
# WARNING!!! DOES NOT BUILD FOR TARGET WITHOUT INTERVENTION!!!  mjn3
#INSTALL_LIBGCJ:=true
INSTALL_LIBGCJ:=false

# For SMP machines some stuff can be run in parallel
#JLEVEL=-j3

-------------- next part --------------
#
# Automatically generated make config: don't edit
#
# TARGET_alpha is not set
# TARGET_arm is not set
# TARGET_cris is not set
# TARGET_e1 is not set
# TARGET_h8300 is not set
# TARGET_i386 is not set
# TARGET_i960 is not set
# TARGET_m68k is not set
# TARGET_microblaze is not set
# TARGET_mips is not set
TARGET_powerpc=y
# TARGET_sh is not set
# TARGET_sparc is not set
# TARGET_v850 is not set

#
# Target Architecture Features and Options
#
HAVE_ELF=y
TARGET_ARCH="powerpc"
ARCH_LITTLE_ENDIAN=y
# ARCH_BIG_ENDIAN is not set
# ARCH_HAS_NO_MMU is not set
UCLIBC_HAS_MMU=y
UCLIBC_HAS_FLOATS=y
HAS_FPU=y
# DO_C99_MATH is not set
WARNINGS="-Wall"
KERNEL_SOURCE="/home/korpo/praktikum/mvme2100/kernel/linux-2.4.25-patched"
C_SYMBOL_PREFIX=""
HAVE_DOT_CONFIG=y

#
# General Library Settings
#
# HAVE_NO_PIC is not set
DOPIC=y
# HAVE_NO_SHARED is not set
HAVE_SHARED=y
# ARCH_HAS_NO_LDSO is not set
BUILD_UCLIBC_LDSO=y
# UCLIBC_PIE_SUPPORT is not set
LDSO_LDD_SUPPORT=y
UCLIBC_CTOR_DTOR=y
# UCLIBC_PROPOLICE is not set
UCLIBC_PROFILING=y
# HAS_NO_THREADS is not set
UCLIBC_HAS_THREADS=y
# PTHREADS_DEBUG_SUPPORT is not set
UCLIBC_HAS_LFS=y
# MALLOC is not set
# MALLOC_SIMPLE is not set
MALLOC_STANDARD=y
# MALLOC_GLIBC_COMPAT is not set
UCLIBC_DYNAMIC_ATEXIT=y
HAS_SHADOW=y
UNIX98PTY_ONLY=y
# ASSUME_DEVPTS is not set
UCLIBC_HAS_TM_EXTENSIONS=y
UCLIBC_HAS_TZ_CACHING=y
UCLIBC_HAS_TZ_FILE=y
UCLIBC_HAS_TZ_FILE_READ_MANY=y
UCLIBC_TZ_FILE_PATH="/etc/TZ"

#
# Networking Support
#
# UCLIBC_HAS_IPV6 is not set
UCLIBC_HAS_RPC=y
# UCLIBC_HAS_FULL_RPC is not set

#
# String and Stdio Support
#
UCLIBC_HAS_CTYPE_TABLES=y
UCLIBC_HAS_CTYPE_SIGNED=y
UCLIBC_HAS_CTYPE_UNSAFE=y
# UCLIBC_HAS_CTYPE_CHECKED is not set
# UCLIBC_HAS_CTYPE_ENFORCED is not set
# UCLIBC_HAS_WCHAR is not set
# UCLIBC_HAS_LOCALE is not set
# UCLIBC_HAS_HEXADECIMAL_FLOATS is not set
# UCLIBC_HAS_GLIBC_CUSTOM_PRINTF is not set
# USE_OLD_VFPRINTF is not set
UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
# UCLIBC_HAS_SCANF_GLIBC_A_FLAG is not set
# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set
# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
UCLIBC_HAS_STDIO_BUFSIZ_4096=y
# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
UCLIBC_HAS_STDIO_GETC_MACRO=y
UCLIBC_HAS_STDIO_PUTC_MACRO=y
UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
# UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE is not set
# UCLIBC_HAS_GLIBC_CUSTOM_STREAMS is not set
# UCLIBC_HAS_PRINTF_M_SPEC is not set
UCLIBC_HAS_ERRNO_MESSAGES=y
# UCLIBC_HAS_SYS_ERRLIST is not set
UCLIBC_HAS_SIGNUM_MESSAGES=y
# UCLIBC_HAS_SYS_SIGLIST is not set
UCLIBC_HAS_GNU_GETOPT=y

#
# Big and Tall
#
UCLIBC_HAS_REGEX=y
# UCLIBC_HAS_WORDEXP is not set
# UCLIBC_HAS_FTW is not set
UCLIBC_HAS_GLOB=y

#
# Library Installation Options
#
SHARED_LIB_LOADER_PREFIX="/lib"
RUNTIME_PREFIX="$(DEVEL_PREFIX)"
DEVEL_PREFIX="/home/korpo/praktikum/mvme2100/tools-2.95/uclibc"

#
# uClibc development/debugging options
#
# DODEBUG is not set
# DOASSERTS is not set
# SUPPORT_LD_DEBUG is not set
# SUPPORT_LD_DEBUG_EARLY is not set
# UCLIBC_MJN3_ONLY is not set


More information about the uClibc mailing list