On Sun, 12 Apr 2020, Rob Landley wrote:
Target: m68k-linux-musl Configured with: ../src_gcc/configure --enable-languages=c,c++ CFLAGS=' -g0 -Os'
Was toysh also built with -Os in CFLAGS? If so, I suggest you try -O2. The reason being that my Gentoo/m68k system failed to build Python with -Os. Like your toysh seg fault, this python seg fault also happened on qemu-system-m68k. This toolchain uses glibc 2.31, gcc 9.3 and binutils 2.34. building '_ctypes' extension ... /bin/sh: line 9: 11966 Segmentation fault LD_LIBRARY_PATH=/var/tmp/portage/dev-lang/python-3.7.7-r1/work/Python-3.7.7 CC='m68k-unknown-linux-gnu-gcc -pthread' LDSHARED='m68k-unknown-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,--as-needed -L. ' CFLAGS='-Wno-unused-result -Wsign-compare -DNDEBUG -Os -fwrapv ' _TCLTK_INCLUDES='' _TCLTK_LIBS='' ./python -E ./setup.py $quiet build make: *** [Makefile:628: sharedmods] Error 139
I have a todo item to pare my 2700 line toysh source file (plus however muchof main.c and lib/*.c it's pulling in, "LDFLAGS=--static CROSS_COMPILE=ccc/m68k-linux-musl-cross/bin/m68k-linux-musl- make sh" makes a 99k m68k binary) down into a minimal reproduction thingy, but I'm trying to get the other targets to finish parsing the init script so I can cut a toybox release.
It would be great to have a minimal reproducer from toysh. Getting that from the python build looks hard, even with creduce. https://embed.cs.utah.edu/creduce/