Hi Niko! On 7/8/19 6:01 PM, Niko Tyni wrote: > The qemu-user specific thing is that $0 (= /proc/pid/cmdline) contains > an absolute path to the binary there regardless of how it was actually > invoked. > > On normal systems: > > % sh -c 'echo $0' > sh > > On qemu-user: > > $ sh -c 'echo $0' > /usr/bin/sh > > It looks like the cflags.SH gets called in a different way in a > subdirectory build, from Configure:2013 or so. In a subdirectory build > it gets run with 'sh < cflags.SH' while in a "normal" build it gets run > as 'sh cflags.SH'. The former causes $0 to contain '/usr/bin/sh' under > qemu-user, and this then gets treated as an absolute path argument. So > the code changes to the same path (here /usr/bin) and tries to create > files there. > > Looking at https://patchwork.kernel.org/patch/9633901/ I suspect > the $0 handling in qemu-user is not easily fixed. I suppose the the > Perl build machinery should handle this case just like it handles > other quirks in weird systems and environments. > > I'll file a bug separately. Fantastic. Thanks so much for narrowing this down. Much appreciated.
This particular issue drove me nuts and I couldn't figure out what the problem is. Glad you found out what the problem was. PS: Can you CC me for the bug report you are filing? Adrian -- .''`. John Paul Adrian Glaubitz : :' : Debian Developer - glaub...@debian.org `. `' Freie Universitaet Berlin - glaub...@physik.fu-berlin.de `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913