armv7l & openSUSE: What the hell…

EDIT: The problem doesn’t occur anymore under openSUSE 12.3 and newer as it appears.

leviathan@shagira:~/rpmbuild/BUILD/clisp-2.49/build> LANG=C ./lisp.run
STACK size: 98222 [0x401bff00 0x40160048]
C_CODE_ALIGNMENT is wrong. &EVAL-WHEN = 0x5f2d1.
Add -falign-functions=4 to CFLAGS in the Makefile.

Especially when you take into consideration, that I just did this:

gcc -falign-functions=4 -g -march=armv7-a -mfloat-abi=hard -mthumb -mabi=aapcs-linux \
-g -DSAFETY=3 -DNO_GENERATIONAL_GC -DNO_MULTIMAP_FILE -DNO_SINGLEMAP -Wa,--noexecstack \
-W -Wswitch -Wcomment -Wpointer-arith -Wimplicit -Wreturn-type -Wmissing-declarations \
-Wno-sign-compare -Wno-format-nonliteral -falign-functions=4 -g -O0 -DDEBUG_OS_ERROR \
-DDEBUG_SPVW -DDEBUG_BYTECODE -DSAFETY=3 -DENABLE_UNICODE -DDYNAMIC_FFI -DDYNAMIC_MODULES \
-I. -Wl,-z,noexecstack  -Wl,--export-dynamic spvw.o spvwtabf.o spvwtabs.o spvwtabo.o \
eval.o control.o encoding.o pathname.o stream.o socket.o io.o funarg.o array.o hashtabl.o \
list.o package.o record.o weak.o sequence.o charstrg.o debug.o error.o misc.o time.o predtype.o \
symbol.o lisparit.o i18n.o foreign.o unixaux.o built.o ariarm.o modules.o /usr/lib/libreadline.so \
-lncurses -ldl /usr/lib/libavcall.a /usr/lib/libcallback.a  -L/usr/lib -lsigsegv libgnu_cl.a -o lisp.run

As I see it, the compiler produces a “broken” aka wrongly optimized executable…

leviathan@shagira:~/rpmbuild/BUILD/clisp-2.49/build> gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/armv7hl-suse-linux-gnueabi/4.7/lto-wrapper
Target: armv7hl-suse-linux-gnueabi
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man 
--libdir=/usr/lib --libexecdir=/usr/lib --enable-languages=c,c++,objc,fortran,obj-c++,java --enable-checking=release 
--with-gxx-include-dir=/usr/include/c++/4.7 --enable-ssp --disable-libssp --disable-libitm --disable-plugin 
--with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux' --disable-libgcj --disable-libmudflap 
--with-slibdir=/lib --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch 
--enable-version-specific-runtime-libs --enable-linker-build-id --program-suffix=-4.7 --enable-linux-futex 
--without-system-libunwind --with-arch=armv7-a --with-tune=cortex-a9 --with-float=hard --with-abi=aapcs-linux
--with-fpu=vfpv3-d16 --disable-sjlj-exceptions --build=armv7hl-suse-linux-gnueabi
Thread model: posix
gcc version 4.7.1 20120723 [gcc-4_7-branch revision 189773] (SUSE Linux)

LUKS crypto root & openSUSE

Hi Folks
Today I’ll tell you how you can implement crypto root with keyfile on your openSUSE
First you will need the following patch (tinkered together for my own setup):
http://ftp.o2s.ch/pub/patches/mkinitrd/crypto_root_luks_mkinitrd.patch

Then you’ll have to apply it and update your initrd:

sudo su
cd
wget http://ftp.o2s.ch/pub/patches/mkinitrd/crypto_root_luks_mkinitrd.patch
cd /
patch -p0 < /root/crypto_root_luks_mkinitrd.patch
mkinitrd -d /dev/mapper/root -f "udev dm storage luks lvm2" -m usb_storage

Next you add the new default boot parameters for grub in /etc/default/grub
In order to do so open the file and look for GRUB_CMDLINE_LINUX_DEFAULT
add the following variables in order to unlock your root partition at bootup
luks_root_keydev=UUID=?? luks_root_keyfile=?? luks_root=UUID=?? luks=root
(replace the ?? by values which fit your setup)