Issues w/ kexec-tools when building images

Philip Prindeville philipp_subx at redfish-solutions.com
Tue May 7 16:47:30 PDT 2024


Actually, I *am* selecting kexec which is part of kexec-tools… though I forget why.

It might be a hangover from when I was bringing up various x86_64 platforms and I needed to be able to boot into a failsafe kernel if the kernel-under-test hung for whatever reason and the watchdog fired…

In any case, it should still build.

I’ll dig into it if I get a chance.  The suspect part is here:

x86_64-openwrt-linux-musl-gcc  -mcmodel=large -I./purgatory/include -I./purgatory/arch/x86_64/include -I./util_lib/include -I./include -Iinclude -I/home/philipp/lede/staging_dir/toolchain-x86_64_gcc-13.2.0_musl/lib/gcc/x86_64-openwrt-linux-musl/13.2.0/include  -c -MD -o purgatory/arch/i386/entry32-16.o purgatory/arch/i386/entry32-16.S


And looking at the Makefile:

https://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git/tree/purgatory/arch/x86_64/Makefile#n18

that is indeed what it wants.

The top-level Makefile says:

AS              = x86_64-openwrt-linux-musl-gcc -c -Os -pipe -g3 -fno-caller-saves -fno-plt -fhonour-copts -fmacro-prefix-map=/home/philipp/lede/build_dir/target-x86_64_musl/kexec-tools-2.0.28=kexec-tools-2.0.28 -ffunction-sections -fdata-sections -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro

but that’s not how it’s being built.

and no ARCH specific flags are defined:

ASFLAGS         =  $($(ARCH)_ASFLAGS)

and the top-level Makefile also has:

%.o: %.S
        @$(MKDIR) -p $(@D)
        $(COMPILE.S) -MD -o $@ $<

so the default definition of COMPILE.S seems to be lacking.  At which point I run out of -fu, because I can’t remember how to get “make” to dump its default definitions (i.e. the equivalent of "echo | gcc -dM -E -“ for make).





> On May 7, 2024, at 4:25 PM, Enéas Ulir de Queiroz <cotequeiroz at gmail.com> wrote:
> 
> I’m nowhere close to being able to even check this, but I will give you a pointer. This usually happens when some Makefile defines multiple packages, one of them depending on kexec-tools (or any package define in its Makefile), and another one—which you are selecting—that doesn’t.  The build dependencies are resolved at the Makefile level, so kexec is pulled if any package in that Makefile is selected. 
> 
> To fix this, you can add a PACKAGE_foo: conditional to the kexec-tools dependency. Then the build dependency will also have that condition, and kexec-tools will not be built. Look at the OpenSSL Makefile for an example (taking it from memory).
> 
> Cheers,
> 
> Eneas 
> 
>> Em 6 de mai. de 2024, à(s) 17:09, Philip Prindeville via openwrt-devel <openwrt-devel at lists.openwrt.org> escreveu:
>> 
>> The sender domain has a DMARC Reject/Quarantine policy which disallows
>> sending mailing list messages using the original "From" header.
>> 
>> To mitigate this problem, the original message has been wrapped
>> automatically by the mailing list software.
>> <mime-attachment>
>> _______________________________________________
>> openwrt-devel mailing list
>> openwrt-devel at lists.openwrt.org
>> https://lists.openwrt.org/mailman/listinfo/openwrt-devel




More information about the openwrt-devel mailing list