#!/bin/bash . $(dirname $0)/common.inc test_cflags -m32 || skip cat < extern char hello[]; int main() { printf("%s\n", hello); } EOF mkdir -p $t/script echo 'OUTPUT_FORMAT(elf32-i386)' > $t/script/libfoo.so $CC -B. -o $t/exe -L$t/script -L$t/lib32 -L$t/lib64 \ $t/e.o -lfoo -Wl,-rpath $t/lib64 >& $t/log grep 'script/libfoo.so: skipping incompatible file' $t/log grep 'lib32/libfoo.so: skipping incompatible file' $t/log grep 'lib32/libfoo.a: skipping incompatible file' $t/log $QEMU $t/exe | grep 'Hello world'