Did you try to set LDFLAGS variable?Karl Godt wrote:. I am also not able to compile findutils ( 4.1.20 , 4.4.0 and 4.5 9 ) statically , even after googling around one or two hours.
LDFLAGS="-static"
yes :LDFLAGS="-static"
from> ./configure --prefix=/usr
> mmake LDFAGS=-static
> make --prefix=$LFS/usr install does the trick
Code: Select all
./configure LDFLAGS=-static CFLAGS=-Os
/Os Favors small code
downloaded uclibc-0.9.30.2-src and this has got a menuconfig that is also quite large ..... Locale doesn't automatically download : wget 404 ....-Os
-Os optimizes for size. -Os enables all -O2 optimizations that do not usually increase code size and performs further optimizations designed to reduce code size.
-Os is very useful for large applications, like Firefox, as it will reduce load time, memory usage, cache misses, disk usage etc. Code compiled with -Os can be faster than -O2 or -O3 because of this. It's also recommended for older computers with a low amount of RAM, disk space or cache on the CPU. But beware that -Os is not as well tested as -O2 and might trigger compiler bugs.
http://downloads.openwrt.org/sources/I recommend getting additional patches from openwrt
http://alpinelinux.org/wiki/Main_Pagemay put alpine linux on a spare partition
it seems that to use it I would have to find+replace "gcc" with "diet" at all makefiles insinde the source ?diet(1) diet(1)
NAME
diet - mangle gcc command line arguments
SYNOPSIS
diet [-v] [-Os] [normal gcc command line]
DESCRIPTION
diet is a small wrapper around gcc. It will try to look at the command
line you specify and try to mangle it so that gcc will compile against
the diet libc header files and link against the diet libc itself.
diet tries to be smart for cross compiling. If the first argument is
not gcc but sparc-linux-gcc, diet will guess that you want to cross
compile for sparc and use bin-sparc/dietlibc.a instead of the
dietlibc.a for your default architecture.
The -v option will make diet print the modified gcc command line before
executing it.
When passed the -Os option before the gcc argument, diet will mangle
the gcc options to include the best known for-size optimization set-
tings for the platform.
FILES
~/.diet/compiler may contain compiler options as you would specify them
on the command line, i.e. separated by spaces. Those will then be used
instead of the built-in defaults for diet -Os.
AUTHOR
Felix von Leitner <felix-dietlibc@fefe.de>
April 2001 diet(1)
Code: Select all
./configure LDFLAGS="-static -Wl,--gc-sections,--as-needed" CFLAGS="-ffunction-sections -fdata-sections -Os" CC="diet gcc -nostdinc" CFLAGS="-D _BSD_SOURCE"
after /* uncommenting */ these two it stopped at two other files .getline.h:35: error: conflicting types for 'gnu_getline'
/usr/dietlibc/include/stdio.h:191: error: previous declaration of 'gnu_getline' was here
getline.h:38: error: conflicting types for 'getdelim'
/usr/dietlibc/include/stdio.h:192: error: previous declaration of 'getdelim' was here
getline.c:139: error: conflicting types for 'gnu_getline'
/usr/dietlibc/include/stdio.h:191: error: previous declaration of 'gnu_getline' was here
getline.c:145: error: conflicting types for 'getdelim'
/usr/dietlibc/include/stdio.h:192: error: previous declaration of 'getdelim' was here
./stdio.h:395: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'rpl_getline'
/usr/dietlibc/include/sys/time.h:10: error: expected specifier-qualifier-list before 'time_t'
/usr/dietlibc/include/signal.h:265: error: expected specifier-qualifier-list before 'pid_t'
/usr/dietlibc/include/sys/fsuid.h:9: error: expected ')' before 'uid'
/usr/dietlibc/include/unistd.h:36: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'lseek'
/usr/dietlibc/include/time.h:20: error: expected ')' before 'clock_id'
/usr/dietlibc/include/wchar.h:34: error: expected ')' before '*' token
Code: Select all
./configure LDFLAGS="-static -Wl,--gc-sections,--as-needed" CFLAGS="-ffunction-sections -fdata-sections -Os -D _BSD_SOURCE" CC="diet gcc -nostdinc"
with outcommented lines for "stpcpy" at getline.h+.c , l10nflist.c , dcigettext.c and for "mbrtowc" at quotearg.cl10nflist.c:(.text._nl_make_l10nflist+0x1b0): undefined reference to `stpcpy'
l10nflist.c:(.text._nl_make_l10nflist+0x1cc): undefined reference to `stpcpy'
../intl/libintl.a(l10nflist.o):l10nflist.c:(.text._nl_make_l10nflist+0x1f8): more undefined references to `stpcpy' follow
collect2: ld returned 1 exit status
make[3]: *** [xargs] Error 1
make[3]: Leaving directory `/COMPILE/FINDUTILS/findutils-4.1.20/xargs'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/COMPILE/FINDUTILS/findutils-4.1.20/xargs'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/COMPILE/FINDUTILS/findutils-4.1.20'
make: *** [all] Error 2
23:16 findutils-4.1.20 # strip /COMPILE/FINDUTILS/findutils-4.1.20/find/find
23:25 findutils-4.1.20 # ls -s /COMPILE/FINDUTILS/findutils-4.1.20/find/find
92 /COMPILE/FINDUTILS/findutils-4.1.20/find/find
23:26 findutils-4.1.20 # file /COMPILE/FINDUTILS/findutils-4.1.20/find/find
/COMPILE/FINDUTILS/findutils-4.1.20/find/find: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped
23:31 findutils-4.1.20 #
Code: Select all
[ "`modinfo aufs | grep vermagic 2>/dev/null`" = "" ]
[ "`modinfo ppa | grep vermagic 2>/dev/null`" != "" ]
Already wondered how to enable them at the menuconfig .maybe try this busybox patch pack that I put together to use the old full e2fsprogs
will take me a while to test it .. there are already 17 _install inside the source dir ... I think I've to delete halv of them ... even some DOTconfigs .... I am getting confused@@ -469,6 +469,10 @@
coreutils/ \
coreutils/libcoreutils/ \
debianutils/ \
+ e2fsprogs/e2p/ \
+ e2fsprogs/ext2fs/ \
+ e2fsprogs/blkid/ \
+ e2fsprogs/uuid/ \
e2fsprogs/ \
editors/ \
findutils/
Next interesting news :Because initrd's find is compressed with UPX.
OK : I'll start that again in 10 hours ... need some sleep now .for stpcpy try adding -lcompat to the end of your LDFLAGS and or this in the includes of the referenced .c file
Code: Select all
./configure LDFLAGS="-static -Wl,--gc-sections,--as-needed -lcompat" CFLAGS="-ffunction-sections -fdata-sections -Os -D _BSD_SOURCE" CC="diet gcc -nostdinc"
Code: Select all
#ifdef _GNU_SOURCE
int vasprintf(char **strp, const char *fmt, va_list ap);
// for FIDUTILS // ssize_t getline(char **lineptr, size_t *n, FILE *stream);
// for FIDUTILS // ssize_t getdelim(char **lineptr, size_t *n, int delim, FILE *stream);
#endif
I made a "fancy-full-blown--long-options-busybox" of statically 844kb and with lzma compressed drivers the initrd.gz became 1363kb . But busybox less and more seem to need nvidiafb or intel-agp support to work like they normally do even at the prompt. ed is described at the menuconfig from year 1970 and "really evil" and somehow it's true : working, but uncomfortable.l10nflist.c:(.text._nl_make_l10nflist+0x1cc): undefined reference to `stpcpy'
../intl/libintl.a(l10nflist.o):l10nflist.c:(.text._nl_make_l10nflist+0x1f8): more undefined references to `stpcpy' follow
collect2: ld returned 1 exit status
make[3]: *** [xargs] Error 1
make[3]: Leaving directory `/COMPILE/FINDUTILS/findutils-4.1.20/xargs'
make[2]: *** [all-recursive] Error 1
Code: Select all
MODALIASES="`cat /sys/bus/pci/devices/*/modalias`" #important, save to variable before loop.
for ONEMODALIAS in $MODALIASES
do
modprobe -v $ONEMODALIAS #-v means verbose.
[ $? -eq 0 ] && echo -n "." > /dev/console
done
for ONEHID in `grep -o 'MODALIAS=hid:[^ ]*' /tmp/uevents.log | cut -f 2 -d '=' | tr '\n' ' '`
do
modprobe $ONEHID
done
One good new : busybox eject is working with creating a symlink to /dev/sr0 from /dev/cdrom .modprobe: module pci:v000010DEd00000182sv0000107Dsd00002922bc03sc00i00 not found in modules.dep
modprobe: module hid:b0003v0000413Cp00002010 not found in modules.dep
Code: Select all
#!/bin/bash
cd `pwd`
./busybox > bbcommands
cat bbcommands | sed '/^$/d' > bbcommands2
BEGIN=`cat -n bbcommands2 | grep Currently | tr -s " " | tr "\t" " " | cut -f 2 -d " "`
LINES=`cat -n bbcommands2 | wc -l`
COMMANDBLOCKLINES=`expr $LINES - $BEGIN`
COMMANDBLOCK=`cat bbcommands2 | tail -n $COMMANDBLOCKLINES | tr ',' ' ' | tr -s " " | tr " " "\n" | tr "\t" " " | tr -d " " | sed '/^$/d'`
for ONELINE in $COMMANDBLOCK ; do
ln -s busybox $ONELINE
done
rm bbcommands
rm bbcommands2
Code: Select all
#!/bin/bash
cd `pwd`
file * | grep symbolic > links
cat links | grep busybox > busyboxlinks
cat busyboxlinks | cut -f 1 -d ':' >busyboxlinks2
BBLINKS=`cat busyboxlinks2`
for ONELINE in "$BBLINKS" ;do
rm $ONELINE
done
rm links
rm busyboxlinks
rm busyboxlinks2
Even if you do allyesconfig, you still need to manually enable full modutils - otherwise it uses the small version which operates differently and thus uses bb.* prefixKarl Godt wrote:I made a "fancy-full-blown--long-options-busybox" of statically 844kb and with lzma compressed drivers the initrd.gz became 1363kb . But busybox less and more seem to need nvidiafb or intel-agp support to work like they normally do even at the prompt. ed is described at the menuconfig from year 1970 and "really evil" and somehow it's true : working, but uncomfortable.
bb modprobe seems to ignore module.alias even if support for modules.alias is enabled ( perhaps just for depmod )
Code: Select all
busybox --list
Code: Select all
for x in `busybox --list`; do ln -s busybox $x;done
Really works at 1.17.1 compiled statically and dynamicallly , and it seems with and without --long-options enabled .busybox --list
Barry's kernels were compiled with vesafb but without console framebuffer. When we boot using vga=??? we get a black screen ( we should blindly type "modprobe fbcon" to get a working console.)technosaurus wrote: Re: look of more/less - I thought Barry's kernels were compiled with vesafb only