sed breaks when statically linked against glibc?

Rob Landley rob at landley.net
Mon Oct 26 22:33:41 UTC 2009


It looks like this old bug has resurfaced yet again:

http://lists.busybox.net/pipermail/busybox/2006-December/025611.html
http://bugs.gentoo.org/show_bug.cgi?id=234547

On xubuntu 9.04, building busybox more or less defconfig, the following sed 
invocation (which turns a .config file into a config.h file) works fine, and 
converts the attached .config into the attached config.h.

# This long and roundabout sed invocation is to make old versions happy.
# New ones have '\n' so can replace one line with two without all the branches
# and tedious mucking about with hold space.

sed -n \
  -e 's/^# CONFIG_\(.*\) is not set.*/\1/' \
  -e 't notset' \
  -e 's/^CONFIG_\(.*\)=y.*/\1/' \
  -e 't isset' \
  -e 's/^CONFIG_\([^=]*\)=\(.*\)/#define CFG_\1 \2/p' \
  -e 'd' \
  -e ':notset' \
  -e 'h' \
  -e 's/.*/#define CFG_& 0/p' \
  -e 'g' \
  -e 's/.*/#define USE_&(...)/p' \
  -e 'd' \
  -e ':isset' \
  -e 'h' \
  -e 's/.*/#define CFG_& 1/p' \
  -e 'g' \
  -e 's/.*/#define USE_&(...) __VA_ARGS__/p' \
  .config > generated/config.h

But when busybox is built with LDFLAGS="--static", busybox sed produces no 
output (and thus an empty config.h.)

I thought busybox had some workaround code for this?  Calling fflush(stdout) via 
atexit() or something similar?

Rob
-- 
Latency is more important than throughput. It's that simple. - Linus Torvalds
-------------- next part --------------
#
# Automatically generated make config: don't edit
# ToyBox version: KCONFIG_VERSION
# Mon Oct 26 17:26:27 2009
#

#
# Global settings
#
# CONFIG_TOYBOX is not set
# CONFIG_TOYBOX_FREE is not set
# CONFIG_TOYBOX_DEBUG is not set

#
# Toys
#
CONFIG_BASENAME=y
CONFIG_BZCAT=y
CONFIG_CAT=y
CONFIG_CATV=y
CONFIG_CHROOT=y
CONFIG_CHVT=y
CONFIG_CKSUM=y
CONFIG_COUNT=y
CONFIG_CP=y
CONFIG_DF=y
CONFIG_DF_PEDANTIC=y
CONFIG_DIRNAME=y
CONFIG_DMESG=y
CONFIG_ECHO=y
CONFIG_FALSE=y
# CONFIG_HELLO is not set
CONFIG_HELP=y
CONFIG_HELP_LONG=y
CONFIG_MDEV=y
CONFIG_MDEV_CONF=y
# CONFIG_MKE2FS is not set
# CONFIG_MKE2FS_JOURNAL is not set
# CONFIG_MKE2FS_GEN is not set
# CONFIG_MKE2FS_LABEL is not set
# CONFIG_MKE2FS_EXTENDED is not set
CONFIG_MKFIFO=y
CONFIG_MKSWAP=y
CONFIG_NETCAT=y
CONFIG_NETCAT_LISTEN=y
CONFIG_ONEIT=y
CONFIG_PATCH=y
CONFIG_PWD=y
# CONFIG_READLINK is not set
# CONFIG_READLINK_F is not set
CONFIG_RMDIR=y
# CONFIG_SED is not set
CONFIG_SEQ=y
CONFIG_SHA1SUM=y
CONFIG_SLEEP=y
CONFIG_SORT=y
CONFIG_SORT_BIG=y
CONFIG_SYNC=y
CONFIG_TEE=y
CONFIG_TOUCH=y
CONFIG_TOYSH=y
# CONFIG_TOYSH_TTY is not set
# CONFIG_TOYSH_PROFILE is not set
# CONFIG_TOYSH_JOBCTL is not set
# CONFIG_TOYSH_FLOWCTL is not set
# CONFIG_TOYSH_QUOTES is not set
# CONFIG_TOYSH_WILDCARDS is not set
# CONFIG_TOYSH_PROCARGS is not set
# CONFIG_TOYSH_ENVVARS is not set
# CONFIG_TOYSH_LOCALS is not set
# CONFIG_TOYSH_ARRAYS is not set
# CONFIG_TOYSH_PIPES is not set
# CONFIG_TOYSH_BUILTINS is not set
# CONFIG_EXIT is not set
# CONFIG_CD is not set
# CONFIG_CD_P is not set
CONFIG_TRUE=y
CONFIG_TTY=y
CONFIG_UNAME=y
CONFIG_WHICH=y
CONFIG_YES=y
-------------- next part --------------
A non-text attachment was scrubbed...
Name: config.h
Type: text/x-chdr
Size: 3710 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20091026/7e5c3a60/attachment.h>


More information about the busybox mailing list