Skip to contentSkip to conversation

silo fails to build with e2fsprogs-1.41.14 (undefined references

DISCUSSION Raúl Porcel 4 participants 13 messages Jan 10, 2011 – Jan 17, 2011

lore
Share & tools
lore
#0 lore raw

Hi,

SILO fails to build here with e2fsprogs-1.41.14 installed, i'm attaching the build log.

The failure is:

Quoted 6 lines

sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c mark.S -o mark.o
ld -m elf32_sparc -N -Ttext 0x280000 -Bstatic -o second crt0.o decomp.o ../common/console.o ../common/printf.o malloc.o ../common/jmp.o ../common/prom.o ../common/tree.o ../common/urem.o ../common/udiv.o ../common/stringops1.o ../common/ffs.o ../common/divdi3.o ../common/udivdi3.o bmark.o main.o cmdline.o disk.o file.o misc.o cfg.o strtol.o ranges.o timer.o memory.o fs/libfs.a mul.o ../common/rem.o ../common/sdiv.o umul.o ../common/stringops2.o ls.o muldi3.o -lext2fs mark.o sparc-unknown-linux-gnu-gcc -print-libgcc-file-name /usr/lib/libext2fs.a(inline.o): In function `ext2fs_get_memalign':
(.text+0x3f4): undefined reference to `posix_memalign'
/usr/lib/libext2fs.a(inode.o): In function `ext2fs_open_inode_scan':
(.text+0x260): undefined reference to `posix_memalign'

Quoted 8 lines

/usr/lib/libext2fs.a(openfs.o): In function `ext2fs_open2':
(.text+0x1e8): undefined reference to posix_memalign' /usr/lib/libext2fs.a(rw_bitmaps.o): In function write_bitmaps':
(.text+0x60): undefined reference to posix_memalign' /usr/lib/libext2fs.a(rw_bitmaps.o): In function write_bitmaps':
(.text+0x264): undefined reference to posix_memalign' /usr/lib/libext2fs.a(rw_bitmaps.o):(.text+0x6c4): more undefined references to posix_memalign' follow make[1]: *** [second] Error 1

The downstream bug is: http://bugs.gentoo.org/show_bug.cgi?id=350677

 * Package: sys-boot/silo-1.4.14_p20100228
 * Repository: gentoo  * Maintainer: [email protected]
 * USE: elibc_glibc kernel_linux sparc userland_GNU
 * FEATURES: sandbox

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

Unpacking source...
Unpacking silo_1.4.14+git20100228.orig.tar.gz to /var/tmp/portage/sys-boot/silo-1.4.14_p20100228/work Unpacking silo_1.4.14+git20100228-1.diff.gz to /var/tmp/portage/sys-boot/silo-1.4.14_p20100228/work Source unpacked in /var/tmp/portage/sys-boot/silo-1.4.14_p20100228/work
Compiling source in /var/tmp/portage/sys-boot/silo-1.4.14_p20100228/work/silo ...

make[1]: Entering directory `/var/tmp/portage/sys-boot/silo-1.4.14_p20100228/work/silo/common'
sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c sdiv.S sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c rem.S sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c udiv.S sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c urem.S sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c jmp.S sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c printf.c sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c console.c sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c -Wa,-Av9 -o prom.o prom.c sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c tree.c sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c stringops2.c sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c stringops1.c sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c ffs.c sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c divdi3.S sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c udivdi3.S
sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -Wl,-O1 -Wl,--as-needed bin2h.c -o bin2h
make[1]: Leaving directory `/var/tmp/portage/sys-boot/silo-1.4.14_p20100228/work/silo/common'
make[1]: Entering directory `/var/tmp/portage/sys-boot/silo-1.4.14_p20100228/work/silo/first'
sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c first.S -o first.o ld -m elf32_sparc -N -Ttext 0x4000 -o first first.o
nm first | grep -v '*ABS*' | sort > first.map
strip first
elftoaout -o first.b first
PT 0 Entry: Loadable to 0x4000[0x1d8] from 0x74[0x1d8] align 0x4
PT 1 Entry: unknown
printf 'SILO'0.99 | dd of=first.b bs=8 conv=notrunc seek=3 count=1
1+0 records in
1+0 records out
8 bytes (8 B) copied, 0.000233737 s, 34.2 kB/s
dd if=/dev/zero of=first.b bs=4 count=1 seek=127
1+0 records in
1+0 records out
4 bytes (4 B) copied, 0.000194261 s, 20.6 kB/s

sed -n 's/^\(000000000000\|0000\)4\([0-9a-f][0-9a-f][0-9a-f]\) .*digit_here.*$/#define DIGIT_OFFSET_TMP 0x\2/p' < first.map > first.h
sed -n 's/^\(000000000000\|0000\)4\([0-9a-f][0-9a-f][0-9a-f]\) .*letter_here.*$/#define LETTER_OFFSET_TMP 0x\2/p' < first.map >> first.h
sed -n 's/^\(000000000000\|0000\)4\([0-9a-f][0-9a-f][0-9a-f]\) .*number_here.*$/#define NUMBER_OFFSET_TMP 0x\2/p' < first.map >> first.h

sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c -Wa,-Av9a ultra.S ld -m elf32_sparc -N -Ttext 0x4000 -o ultra ultra.o
nm ultra | grep -v '*ABS*' | sort > ultra.map
strip ultra
elftoaout -o ultra.b ultra
PT 0 Entry: Loadable to 0x4000[0x1d4] from 0x74[0x1d4] align 0x4
PT 1 Entry: unknown
printf 'SILO'0.99 | dd of=ultra.b bs=8 conv=notrunc seek=3 count=1
1+0 records in
1+0 records out
8 bytes (8 B) copied, 0.000247267 s, 32.4 kB/s
printf '\340' | dd of=ultra.b bs=1 count=1 seek=7 conv=notrunc
1+0 records in
1+0 records out
1 byte (1 B) copied, 0.000245072 s, 4.1 kB/s
dd if=/dev/zero of=ultra.b bs=4 count=1 seek=127
1+0 records in
1+0 records out
4 bytes (4 B) copied, 0.000200022 s, 20.0 kB/s
sed -n 's/^\(000000000000\|0000\)4\([0-9a-f][0-9a-f][0-9a-f]\) .*letter_here.*$/#define ULTRA_LETTER_OFFSET_TMP 0x\2/p' < ultra.map > ultra.h
sed -n 's/^\(000000000000\|0000\)4\([0-9a-f][0-9a-f][0-9a-f]\) .*number_here.*$/#define ULTRA_NUMBER_OFFSET_TMP 0x\2/p' < ultra.map >> ultra.h
sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c -Wa,-Av9a generic.S ld -m elf32_sparc -N -Ttext 0x4000 -o generic generic.o
nm generic | grep -v '*ABS*' | sort > generic.map
strip generic
elftoaout -o generic.b generic
PT 0 Entry: Loadable to 0x4000[0x400] from 0x200[0x400] align 0x200
PT 1 Entry: unknown
printf 'SILO'0.99 | dd of=generic.b bs=8 conv=notrunc seek=3 count=1
1+0 records in
1+0 records out
8 bytes (8 B) copied, 0.000266353 s, 30.0 kB/s
printf '\340' | dd of=generic.b bs=1 count=1 seek=7 conv=notrunc
1+0 records in
1+0 records out
1 byte (1 B) copied, 0.000257062 s, 3.9 kB/s
dd if=/dev/zero of=generic.b bs=4 count=1 seek=255
1+0 records in
1+0 records out
4 bytes (4 B) copied, 0.000202898 s, 19.7 kB/s

sed -n 's/^\(000000000000\|0000\)4\([0-9a-f][0-9a-f][0-9a-f]\) .*digit_here.*$/#define GENERIC_DIGIT_OFFSET_TMP 0x\2/p' < generic.map > generic.h
sed -n 's/^\(000000000000\|0000\)4\([0-9a-f][0-9a-f][0-9a-f]\) .*letter_here.*$/#define GENERIC_LETTER_OFFSET_TMP 0x\2/p' < generic.map >> generic.h
sed -n 's/^\(000000000000\|0000\)4\([0-9a-f][0-9a-f][0-9a-f]\) .*number_here.*$/#define GENERIC_NUMBER_OFFSET_TMP 0x\2/p' < generic.map >> generic.h

sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c -Wa,-Av9a fd.S
ld -m elf32_sparc -N -Ttext 0x4000 -o fd fd.o
nm fd | grep -v '*ABS*' | sort > fd.map
strip fd
elftoaout -o fd.b fd
PT 0 Entry: Loadable to 0x4000[0x400] from 0x200[0x400] align 0x200
PT 1 Entry: unknown
printf 'SILO'0.99 | dd of=fd.b bs=8 conv=notrunc seek=3 count=1
1+0 records in
1+0 records out
8 bytes (8 B) copied, 0.000262997 s, 30.4 kB/s
printf '\340' | dd of=fd.b bs=1 count=1 seek=7 conv=notrunc
1+0 records in
1+0 records out
1 byte (1 B) copied, 0.00023724 s, 4.2 kB/s
dd if=/dev/zero of=fd.b bs=4 count=1 seek=255
1+0 records in
1+0 records out
4 bytes (4 B) copied, 0.000225489 s, 17.7 kB/s
sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -DIMGVERSION='"SILO0.99"' -c ieee32.S
ld -m elf32_sparc -N -Ttext 0x4000 -o ieee32.b ieee32.o
nm ieee32.b | grep -v '*ABS*' | sort > ieee32.map
strip ieee32.b
chmod 644 ieee32.b
make[1]: Leaving directory `/var/tmp/portage/sys-boot/silo-1.4.14_p20100228/work/silo/first'
make[1]: Entering directory `/var/tmp/portage/sys-boot/silo-1.4.14_p20100228/work/silo/second'
sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c -Wa,-Av9 -DIMGVERSION='"SILO0.99"' crt0.S
sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -DVERSION='"1.4.14_git2010228_p1"' -c decomp.c
sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c -o malloc.o ../common/malloc.c
sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c bmark.S -o bmark.o
sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c main.c -o main.o
main.c: In function 'bootmain':
main.c:1043:19: warning: 'params' may be used uninitialized in this function
sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c cmdline.c -o cmdline.o
sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c disk.c -o disk.o
sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c file.c -o file.o
sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c misc.c -o misc.o
sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c cfg.c -o cfg.o
sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c strtol.c -o strtol.o
sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c ranges.c -o ranges.o
sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c -Wa,-Av9a timer.c
sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c -Wa,-Av9 memory.c
sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c fs/iom.c -o fs/iom.o
sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c fs/ext2.c -o fs/ext2.o
sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c fs/isofs.c -o fs/isofs.o
sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c fs/romfs.c -o fs/romfs.o
fs/romfs.c:37:0: warning: "BLOCK_SIZE_BITS" redefined
/usr/include/linux/fs.h:27:0: note: this is the location of the previous definition
sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c fs/ufs.c -o fs/ufs.o
rm -f fs/libfs.a
ar rc fs/libfs.a fs/iom.o fs/ext2.o fs/isofs.o fs/romfs.o fs/ufs.o
sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c mul.S -o mul.o
sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c umul.S -o umul.o
sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c ls.c -o ls.o
sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c muldi3.S -o muldi3.o
sparc-unknown-linux-gnu-gcc -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -U_FORTIFY_SOURCE -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c mark.S -o mark.o
ld -m elf32_sparc -N -Ttext 0x280000 -Bstatic -o second crt0.o decomp.o ../common/console.o ../common/printf.o malloc.o ../common/jmp.o ../common/prom.o ../common/tree.o ../common/urem.o ../common/udiv.o ../common/stringops1.o ../common/ffs.o ../common/divdi3.o ../common/udivdi3.o bmark.o main.o cmdline.o disk.o file.o misc.o cfg.o strtol.o ranges.o timer.o memory.o fs/libfs.a mul.o ../common/rem.o ../common/sdiv.o umul.o ../common/stringops2.o ls.o muldi3.o -lext2fs mark.o sparc-unknown-linux-gnu-gcc -print-libgcc-file-name /usr/lib/libext2fs.a(inline.o): In function `ext2fs_get_memalign':
(.text+0x3f4): undefined reference to `posix_memalign'
/usr/lib/libext2fs.a(inode.o): In function `ext2fs_open_inode_scan':
(.text+0x260): undefined reference to `posix_memalign'
/usr/lib/libext2fs.a(openfs.o): In function `ext2fs_open2':
(.text+0x1e8): undefined reference to `posix_memalign'
/usr/lib/libext2fs.a(rw_bitmaps.o): In function `write_bitmaps':
(.text+0x60): undefined reference to `posix_memalign'
/usr/lib/libext2fs.a(rw_bitmaps.o): In function `write_bitmaps':
(.text+0x264): undefined reference to `posix_memalign'
/usr/lib/libext2fs.a(rw_bitmaps.o):(.text+0x6c4): more undefined references to `posix_memalign' follow
make[1]: *** [second] Error 1
make[1]: Leaving directory `/var/tmp/portage/sys-boot/silo-1.4.14_p20100228/work/silo/second'
make: *** [all] Error 1
* ERROR: sys-boot/silo-1.4.14_p20100228 failed:
* (no error message)
*
* Call stack:
* ebuild.sh, line 56: Called src_compile
* environment, line 2779: Called die
* The specific snippet of code:
* make ${MAKEOPTS} CC="$(tc-getCC)" || die;
*
* If you need support, post the output of 'emerge --info =sys-boot/silo-1.4.14_p20100228',
* the complete build log and the output of 'emerge -pqv =sys-boot/silo-1.4.14_p20100228'.
* The complete build log is located at '/var/tmp/portage/sys-boot/silo-1.4.14_p20100228/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/portage/sys-boot/silo-1.4.14_p20100228/temp/environment'.
* S: '/var/tmp/portage/sys-boot/silo-1.4.14_p20100228/work/silo'

#1 lore raw

Re: silo fails to build with e2fsprogs-1.41.14 (undefined

From: Raúl Porcel <[email protected]>
Date: Mon, 10 Jan 2011 20:10:36 +0100

Quoted 4 lines

Hi,

SILO fails to build here with e2fsprogs-1.41.14 installed, i'm attaching the build log.

I really appreciate how they make libext2 harder and harder to link into embedded self-contained things like bootloaders over time.

I just pushed the following fix for this:

--------------------
second: Add dummy posix_memalign stubb for libext2

---
 second/fs/ext2.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
second/fs/ext2.c +6 -0
index 57f5e9a..12d00dc 100644
@@ -163,3 +163,9 @@ void *realloc(void *p, int size)
 {
         return NULL;
 }
+
+int posix_memalign(void **memptr, size_t alignment, size_t size)
+{
+	*memptr = NULL;
+	return -1;
+}
Signature · 1 line
1.7.3.4
#2 lore raw
In reply to Raúl Porcel
Quoted 5 lines · David Miller

From: Raúl Porcel <[email protected]>
Date: Mon, 10 Jan 2011 20:10:36 +0100

Quoted 2 lines

Hi,

Quoted 8 lines
Quoted 2 lines

SILO fails to build here with e2fsprogs-1.41.14 installed, i'm attaching the build log.

I really appreciate how they make libext2 harder and harder to link into embedded self-contained things like bootloaders over time.

I just pushed the following fix for this:
<snip>

Hi,

Thanks, it builds, but silo fails to work:

Boot device: disk1 File and args:
SILO Version 1.4.14_git2010228_p1

Unknown ext2 error: 4294967295

Fatal error: Unable to open filesystem

Couldn't load /etc/silo.conf
No config file loaded, you can boot just from this command line Type [prompath;]part/path_to_image [parameters] on the prompt E.g. /iommu/sbus/espdma/esp/sd@3,0;4/vmlinux root=/dev/sda4 or 2/vmlinux.live (to load vmlinux.live from 2nd partition of boot disk) boot:

#3 lore raw

Re: silo fails to build with e2fsprogs-1.41.14 (undefined

In reply to Raúl Porcel
Quoted 25 lines · Raúl Porcel
Quoted 5 lines · David Miller

From: Raúl Porcel <[email protected]>
Date: Mon, 10 Jan 2011 20:10:36 +0100

Quoted 2 lines

Hi,

Quoted 8 lines
Quoted 2 lines

SILO fails to build here with e2fsprogs-1.41.14 installed, i'm attaching the build log.

I really appreciate how they make libext2 harder and harder to link into embedded self-contained things like bootloaders over time.

I just pushed the following fix for this:
<snip>

Hi,

Thanks, it builds, but silo fails to work:

Boot device: disk1 File and args:
SILO Version 1.4.14_git2010228_p1

Unknown ext2 error: 4294967295

Quoted 8 lines

Fatal error: Unable to open filesystem

Couldn't load /etc/silo.conf
No config file loaded, you can boot just from this command line Type [prompath;]part/path_to_image [parameters] on the prompt E.g. /iommu/sbus/espdma/esp/sd@3,0;4/vmlinux root=/dev/sda4 or 2/vmlinux.live (to load vmlinux.live from 2nd partition of boot disk) boot:

This problem exists with all versions of silo linked against e2fsprogs-1.41.14.

I think there is a bug in e2fsprogs as it doesn't seem to properly handle error codes returned by the posix_memalign() function. It's either that or a proper implementation of posix_memalign() function needs to be detected through the configure scripts.

Signature · 1 line
Tactical Nuclear Kittens
#4 lore raw

Re: silo fails to build with e2fsprogs-1.41.14 (undefined

In reply to Raúl Porcel

From: Alex Buell <[email protected]>
Date: Sat, 15 Jan 2011 12:57:09 +0000

Quoted 4 lines

I think there is a bug in e2fsprogs as it doesn't seem to properly handle error codes returned by the posix_memalign() function. It's either that or a proper implementation of posix_memalign() function needs to be detected through the configure scripts.

I think it requires a real properly functioning posix_memalign().

The issue is that the detection occurs when the e2fsprogs package is built, and in userland's libc there is in fact a full and functioning posix_memalign(). So e2fsprogs is doing nothing wrong.

The problem is that SILO is linking e2fsprogs into it's limited environment, and we have to bolt on hacks over time as e2fsprogs depends upon newer facilities in userland.

I'll try to fix this.

#5 lore raw

Re: silo fails to build with e2fsprogs-1.41.14 (undefined

In reply to Raúl Porcel

From: Alex Buell <[email protected]>
Date: Sat, 15 Jan 2011 12:57:09 +0000

Quoted 17 lines · Raúl Porcel
Quoted 7 lines

Thanks, it builds, but silo fails to work:

Boot device: disk1 File and args:
SILO Version 1.4.14_git2010228_p1

Unknown ext2 error: 4294967295

Quoted 8 lines

Fatal error: Unable to open filesystem

Couldn't load /etc/silo.conf
No config file loaded, you can boot just from this command line Type [prompath;]part/path_to_image [parameters] on the prompt E.g. /iommu/sbus/espdma/esp/sd@3,0;4/vmlinux root=/dev/sda4 or 2/vmlinux.live (to load vmlinux.live from 2nd partition of boot disk) boot:

Quoted 2 lines

This problem exists with all versions of silo linked against e2fsprogs-1.41.14.

Can you guys please test this patch out? It's against the current tree.

Thanks!

--------------------
malloc: Provide posix_memalign() implementation.

ext2progs library really wants a working version of this, and thankfully it's not that hard to do.

common/malloc.c +31 -1
index cc3946d..d05061b 100644
@@ -27,6 +27,12 @@ static char *malloc_ptr = (char *) MALLOC_BASE;
 
 static char *last_alloc = 0;
 
+static char *align_ptr_to(char *ptr, unsigned long align)
+{
+    return (char *) ((((unsigned long) ptr) + (align - 1UL)) &
+		     ~(align - 1UL));
+}
+
 void *malloc (int size)
 {
     char *caddr;
@@ -34,10 +40,34 @@ void *malloc (int size)
     caddr = malloc_ptr;
     malloc_ptr += size;
     last_alloc = caddr;
-    malloc_ptr = (char *) ((((unsigned long) malloc_ptr) + 7) & (~7));
+    malloc_ptr = align_ptr_to(malloc_ptr, 7UL);
     return caddr;
 }
 
+int posix_memalign(void **memptr, unsigned long alignment, unsigned long size)
+{
+    char *caddr;
+
+    if (alignment & (alignment - 1UL))
+        return -1;
+    if (alignment & (sizeof(void *) - 1UL))
+        return -1;
+
+    if (size = 0) {
+      *memptr = (void *) 0;
+      return 0;
+    }
+
+    caddr = align_ptr_to(malloc_ptr, alignment);
+    malloc_ptr = (caddr + size);
+    last_alloc = caddr;
+    malloc_ptr = align_ptr_to(malloc_ptr, 7UL);
+
+    *memptr = caddr;
+
+    return 0;
+}
+
 void free (void *m)
 {
     if (m = last_alloc)
second/fs/ext2.c +0 -6
index 12d00dc..57f5e9a 100644
@@ -163,9 +163,3 @@ void *realloc(void *p, int size)
 {
         return NULL;
 }
-
-int posix_memalign(void **memptr, size_t alignment, size_t size)
-{
-	*memptr = NULL;
-	return -1;
-}
#6 lore raw

Re: silo fails to build with e2fsprogs-1.41.14 (undefined

In reply to Raúl Porcel
Quoted 94 lines · David Miller

From: Alex Buell <[email protected]>
Date: Sat, 15 Jan 2011 12:57:09 +0000

Quoted 17 lines · Raúl Porcel
Quoted 7 lines

Thanks, it builds, but silo fails to work:

Boot device: disk1 File and args:
SILO Version 1.4.14_git2010228_p1

Unknown ext2 error: 4294967295

Quoted 8 lines

Fatal error: Unable to open filesystem

Couldn't load /etc/silo.conf
No config file loaded, you can boot just from this command line Type [prompath;]part/path_to_image [parameters] on the prompt E.g. /iommu/sbus/espdma/esp/sd@3,0;4/vmlinux root=/dev/sda4 or 2/vmlinux.live (to load vmlinux.live from 2nd partition of boot disk) boot:

Quoted 2 lines

This problem exists with all versions of silo linked against e2fsprogs-1.41.14.

Can you guys please test this patch out? It's against the current tree.

Thanks!

--------------------
malloc: Provide posix_memalign() implementation.

ext2progs library really wants a working version of this, and thankfully it's not that hard to do.

common/malloc.c +31 -1
index cc3946d..d05061b 100644
@@ -27,6 +27,12 @@ static char *malloc_ptr = (char *) MALLOC_BASE;
 
 static char *last_alloc = 0;
 
+static char *align_ptr_to(char *ptr, unsigned long align)
+{
+    return (char *) ((((unsigned long) ptr) + (align - 1UL)) &
+		     ~(align - 1UL));
+}
+
 void *malloc (int size)
 {
     char *caddr;
@@ -34,10 +40,34 @@ void *malloc (int size)
     caddr = malloc_ptr;
     malloc_ptr += size;
     last_alloc = caddr;
-    malloc_ptr = (char *) ((((unsigned long) malloc_ptr) + 7) & (~7));
+    malloc_ptr = align_ptr_to(malloc_ptr, 7UL);
     return caddr;
 }
 
+int posix_memalign(void **memptr, unsigned long alignment, unsigned long size)
+{
+    char *caddr;
+
+    if (alignment & (alignment - 1UL))
+        return -1;
+    if (alignment & (sizeof(void *) - 1UL))
+        return -1;
+
+    if (size = 0) {
+      *memptr = (void *) 0;
+      return 0;
+    }
+
+    caddr = align_ptr_to(malloc_ptr, alignment);
+    malloc_ptr = (caddr + size);
+    last_alloc = caddr;
+    malloc_ptr = align_ptr_to(malloc_ptr, 7UL);
+
+    *memptr = caddr;
+
+    return 0;
+}
+
 void free (void *m)
 {
     if (m = last_alloc)
second/fs/ext2.c +0 -0
index 12d00dc..57f5e9a 100644

second/fs/ext2.c void *realloc(void *p, int size) · line 171

Quoted 9 lines
second/fs/ext2.c +0 -6
@@ -163,9 +163,3 @@ void *realloc(void *p, int size)
 {
         return NULL;
 }
-
-int posix_memalign(void **memptr, size_t alignment, size_t size)
-{
-	*memptr = NULL;
-	return -1;
-}

I'll test it first thing tomorrow morning. The 'Blade 2000's busy cross-compiling PPC packages for my dog-slow iMac at the moment.

Signature · 1 line
Tactical Nuclear Kittens
#7 lore raw

Re: silo fails to build with e2fsprogs-1.41.14 (undefined

In reply to Raúl Porcel
Quoted 94 lines · David Miller

From: Alex Buell <[email protected]>
Date: Sat, 15 Jan 2011 12:57:09 +0000

Quoted 17 lines · Raúl Porcel
Quoted 7 lines

Thanks, it builds, but silo fails to work:

Boot device: disk1 File and args:
SILO Version 1.4.14_git2010228_p1

Unknown ext2 error: 4294967295

Quoted 8 lines

Fatal error: Unable to open filesystem

Couldn't load /etc/silo.conf
No config file loaded, you can boot just from this command line Type [prompath;]part/path_to_image [parameters] on the prompt E.g. /iommu/sbus/espdma/esp/sd@3,0;4/vmlinux root=/dev/sda4 or 2/vmlinux.live (to load vmlinux.live from 2nd partition of boot disk) boot:

Quoted 2 lines

This problem exists with all versions of silo linked against e2fsprogs-1.41.14.

Can you guys please test this patch out? It's against the current tree.

Thanks!

--------------------
malloc: Provide posix_memalign() implementation.

ext2progs library really wants a working version of this, and thankfully it's not that hard to do.

common/malloc.c +31 -1
index cc3946d..d05061b 100644
@@ -27,6 +27,12 @@ static char *malloc_ptr = (char *) MALLOC_BASE;
 
 static char *last_alloc = 0;
 
+static char *align_ptr_to(char *ptr, unsigned long align)
+{
+    return (char *) ((((unsigned long) ptr) + (align - 1UL)) &
+		     ~(align - 1UL));
+}
+
 void *malloc (int size)
 {
     char *caddr;
@@ -34,10 +40,34 @@ void *malloc (int size)
     caddr = malloc_ptr;
     malloc_ptr += size;
     last_alloc = caddr;
-    malloc_ptr = (char *) ((((unsigned long) malloc_ptr) + 7) & (~7));
+    malloc_ptr = align_ptr_to(malloc_ptr, 7UL);
     return caddr;
 }
 
+int posix_memalign(void **memptr, unsigned long alignment, unsigned long size)
+{
+    char *caddr;
+
+    if (alignment & (alignment - 1UL))
+        return -1;
+    if (alignment & (sizeof(void *) - 1UL))
+        return -1;
+
+    if (size = 0) {
+      *memptr = (void *) 0;
+      return 0;
+    }
+
+    caddr = align_ptr_to(malloc_ptr, alignment);
+    malloc_ptr = (caddr + size);
+    last_alloc = caddr;
+    malloc_ptr = align_ptr_to(malloc_ptr, 7UL);
+
+    *memptr = caddr;
+
+    return 0;
+}
+
 void free (void *m)
 {
     if (m = last_alloc)
second/fs/ext2.c +0 -0
index 12d00dc..57f5e9a 100644

second/fs/ext2.c void *realloc(void *p, int size) · line 171

Quoted 9 lines
second/fs/ext2.c +0 -6
@@ -163,9 +163,3 @@ void *realloc(void *p, int size)
 {
         return NULL;
 }
-
-int posix_memalign(void **memptr, size_t alignment, size_t size)
-{
-	*memptr = NULL;
-	return -1;
-}

With that patch, I now get a different error:

SILO Version 1.4.14
ERROR: Last trap: Memory Address not aligned

Error -256
{0] OK

(Now I've got to boot off my rescue CD and rebuild SILO)

Is anyone else getting the same error?

Signature · 1 line
Tactical Nuclear Kittens
#8 lore raw
In reply to Raúl Porcel
Quoted 45 lines · Alex Buell
Quoted 44 lines · David Miller

From: Alex Buell<[email protected]>
Date: Sat, 15 Jan 2011 12:57:09 +0000

Quoted 17 lines · Raúl Porcel
Quoted 7 lines

Thanks, it builds, but silo fails to work:

Boot device: disk1 File and args:
SILO Version 1.4.14_git2010228_p1

Unknown ext2 error: 4294967295

Quoted 8 lines

Fatal error: Unable to open filesystem

Couldn't load /etc/silo.conf
No config file loaded, you can boot just from this command line Type [prompath;]part/path_to_image [parameters] on the prompt E.g. /iommu/sbus/espdma/esp/sd@3,0;4/vmlinux root=/dev/sda4 or 2/vmlinux.live (to load vmlinux.live from 2nd partition of boot disk) boot:

Quoted 2 lines

This problem exists with all versions of silo linked against e2fsprogs-1.41.14.

Can you guys please test this patch out? It's against the current tree.

Thanks!

--------------------
malloc: Provide posix_memalign() implementation.

ext2progs library really wants a working version of this, and thankfully it's not that hard to do.

common/malloc.c +0 -0
index cc3946d..d05061b 100644
@@ -27,6 +27,12 @@ static char *malloc_ptr = (char *) MALLOC_BASE;
 
  static char *last_alloc = 0;
 
Quoted 15 lines
Quoted 10 lines
common/malloc.c +6 -0
+static char *align_ptr_to(char *ptr, unsigned long align)
+{
+    return (char *) ((((unsigned long) ptr) + (align - 1UL))&
+		     ~(align - 1UL));
+}
+
  void *malloc (int size)
  {
      char *caddr;

common/malloc.c void *malloc (int size) · line 43

Quoted 5 lines
common/malloc.c +1 -1
@@ -34,10 +40,34 @@ void *malloc (int size)
      caddr = malloc_ptr;
      malloc_ptr += size;
      last_alloc = caddr;
-    malloc_ptr = (char *) ((((unsigned long) malloc_ptr) + 7)&  (~7));
+    malloc_ptr = align_ptr_to(malloc_ptr, 7UL);

I think that should be 8UL because align_ptr_to does -1 to make it 7.

Quoted 13 lines
Quoted 13 lines
common/malloc.c +10 -0
      return caddr;
  }
 
+int posix_memalign(void **memptr, unsigned long alignment, unsigned long size)
+{
+    char *caddr;
+
+    if (alignment&  (alignment - 1UL))
+        return -1;
+    if (alignment&  (sizeof(void *) - 1UL))
+        return -1;
+
+    if (size = 0) {
Quoted 8 lines

common/malloc.c void *malloc (int size) · line 64

Quoted 8 lines
common/malloc.c +8 -0
+      *memptr = (void *) 0;
+      return 0;
+    }
+
+    caddr = align_ptr_to(malloc_ptr, alignment);
+    malloc_ptr = (caddr + size);
+    last_alloc = caddr;
+    malloc_ptr = align_ptr_to(malloc_ptr, 7UL);

Ditto

Regards

Richard

Quoted 35 lines
Quoted 14 lines
common/malloc.c +6 -0
+
+    *memptr = caddr;
+
+    return 0;
+}
+
  void free (void *m)
  {
      if (m = last_alloc)
second/fs/ext2.c +0 -0
index 12d00dc..57f5e9a 100644

second/fs/ext2.c void *realloc(void *p, int size) · line 171

Quoted 9 lines
second/fs/ext2.c +0 -6
@@ -163,9 +163,3 @@ void *realloc(void *p, int size)
  {
          return NULL;
  }
-
-int posix_memalign(void **memptr, size_t alignment, size_t size)
-{
-	*memptr = NULL;
-	return -1;
-}

With that patch, I now get a different error:

SILO Version 1.4.14
ERROR: Last trap: Memory Address not aligned

Error -256
{0] OK

(Now I've got to boot off my rescue CD and rebuild SILO)

Is anyone else getting the same error?

#9 lore raw

Re: silo fails to build with e2fsprogs-1.41.14 (undefined

In reply to Raúl Porcel
Quoted 6 lines · Richard Mortimer
Quoted 2 lines

Review

Quoted 2 lines
(quoted diff) +1 -1
-    malloc_ptr = (char *) ((((unsigned long) malloc_ptr) + 7)&  (~7));
+    malloc_ptr = align_ptr_to(malloc_ptr, 7UL);

I think that should be 8UL because align_ptr_to does -1 to make it 7.

Quoted 1 line
Quoted 1 line

+ malloc_ptr = align_ptr_to(malloc_ptr, 7UL);

Ditto

That would explain the different error, this time it was 256, the previous error was -1^32.

I'll change the patch with the new values and see if that works.

Signature · 1 line
Tactical Nuclear Kittens
#10 lore raw

Re: silo fails to build with e2fsprogs-1.41.14 (undefined

In reply to Raúl Porcel
Quoted 8 lines · Alex Buell
Quoted 1 line · Richard Mortimer
Quoted 1 line
Quoted 1 line

- malloc_ptr = (char *) ((((unsigned long) malloc_ptr) + 7)&

(~7));

Quoted 2 lines
Quoted 1 line
Quoted 1 line

+ malloc_ptr = align_ptr_to(malloc_ptr, 7UL);

I think that should be 8UL because align_ptr_to does -1 to make it

7.

Quoted 7 lines
Quoted 2 lines
Quoted 1 line
Quoted 1 line

+ malloc_ptr = align_ptr_to(malloc_ptr, 7UL);

Ditto

That would explain the different error, this time it was 256, the previous error was -1^32.

I'll change the patch with the new values and see if that works.

Well done, that fixed the problem. Thank you. For anyone who's interested, here's the patch in full with Richard Mortimer's changes:

common/malloc.c +8 -1
diff -uNr silo-1.4.14/second/fs/ext2.c silo/second/fs/ext2.c
@@ -27,6 +27,12 @@ static char *malloc_ptr = (char *) MALLOC_BASE;
 
 static char *last_alloc = 0;
 
+static char *align_ptr_to(char *ptr, unsigned long align)
+{
+    return (char *) ((((unsigned long) ptr) + (align - 1UL)) &
+                    ~(align - 1UL));
+}
+
 void *malloc (int size)
 {
     char *caddr;
@@ -34,10 +40,34 @@ void *malloc (int size)
     caddr = malloc_ptr;
     malloc_ptr += size;
     last_alloc = caddr;
-    malloc_ptr = (char *) ((((unsigned long) malloc_ptr) + 7) & (~7));
+    malloc_ptr = align_ptr_to(malloc_ptr, 8UL);
     return caddr;
 }
 
+int posix_memalign(void **memptr, unsigned long alignment, unsigned

long size)
+{
+ char *caddr;
+
+ if (alignment & (alignment - 1UL))
+ return -1;
+ if (alignment & (sizeof(void *) - 1UL))
+ return -1;
+
+ if (size = 0) {
+ *memptr = (void *) 0;
+ return 0;
+ }
+

+    caddr = align_ptr_to(malloc_ptr, alignment);
+    malloc_ptr = (caddr + size);
+    last_alloc = caddr;
+    malloc_ptr = align_ptr_to(malloc_ptr, 8UL);

+
+ *memptr = caddr;
+
+ return 0;
+}
+
void free (void *m)
{
if (m = last_alloc)

Signature · 1 line
Tactical Nuclear Kittens
#11 lore raw

Re: silo fails to build with e2fsprogs-1.41.14 (undefined

In reply to Raúl Porcel

From: Alex Buell <[email protected]>
Date: Mon, 17 Jan 2011 17:35:27 +0000

Quoted 12 lines · Alex Buell
Quoted 11 lines · Richard Mortimer
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

- malloc_ptr = (char *) ((((unsigned long) malloc_ptr) + 7)&

(~7));

Quoted 2 lines
Quoted 1 line
Quoted 1 line

+ malloc_ptr = align_ptr_to(malloc_ptr, 7UL);

I think that should be 8UL because align_ptr_to does -1 to make it

7.

Quoted 2 lines
Quoted 1 line
Quoted 1 line

+ malloc_ptr = align_ptr_to(malloc_ptr, 7UL);

Ditto

Quoted 7 lines
Quoted 4 lines

That would explain the different error, this time it was 256, the previous error was -1^32.

I'll change the patch with the new values and see if that works.

Well done, that fixed the problem. Thank you. For anyone who's interested, here's the patch in full with Richard Mortimer's changes:

Thanks a lot, sorry for the stupid thinko :-)

#12 lore raw

Re: silo fails to build with e2fsprogs-1.41.14 (undefined

In reply to Raúl Porcel

From: Alex Buell <[email protected]>
Date: Mon, 17 Jan 2011 17:35:27 +0000

Quoted 2 lines

Well done, that fixed the problem. Thank you. For anyone who's interested, here's the patch in full with Richard Mortimer's changes:

The final working version is pushed to the silo GIT repo, please double check that it works fine there too.

Thanks!