diff mbox

[OpenWrt-Devel] Allow kernel modules to keep build ID debug symbol.

Message ID 87mvv0cto3.fsf@toke.dk
State RFC
Headers show

Commit Message

Toke Høiland-Jørgensen Oct. 30, 2015, 2:33 p.m. UTC
Felix Fietkau <nbd@openwrt.org> writes:

>> Would definitely work. The problem is I'm not sure I quite grok the
>> openwrt build system sufficiently to do this correctly. Guess I need to
>> get the linker flag into KERNEL_MAKEOPTS?
> Yes. It's in kernel-defaults.mk

Cool, this part works.

>> Can go looking for that, but
>> that still leaves the problem of signaling the strip-kmod.sh script
>> correctly -- can I get at per-package variables in rules.mk where the
>> RSTRIP invocation is defined?
> You can add it wrapped in $(if ...) to rules.mk to the other exports in
> the RSTRIP variable.

Yeah, that's what I thought; but the obvious way (below) doesn't seem to
work. Can I not expand the PKG_* variables in rules.mk?

-Toke

Comments

Felix Fietkau Oct. 30, 2015, 2:35 p.m. UTC | #1
On 2015-10-30 15:33, Toke Høiland-Jørgensen wrote:
> Felix Fietkau <nbd@openwrt.org> writes:
> 
>>> Would definitely work. The problem is I'm not sure I quite grok the
>>> openwrt build system sufficiently to do this correctly. Guess I need to
>>> get the linker flag into KERNEL_MAKEOPTS?
>> Yes. It's in kernel-defaults.mk
> 
> Cool, this part works.
> 
>>> Can go looking for that, but
>>> that still leaves the problem of signaling the strip-kmod.sh script
>>> correctly -- can I get at per-package variables in rules.mk where the
>>> RSTRIP invocation is defined?
>> You can add it wrapped in $(if ...) to rules.mk to the other exports in
>> the RSTRIP variable.
> 
> Yeah, that's what I thought; but the obvious way (below) doesn't seem to
> work. Can I not expand the PKG_* variables in rules.mk?
> 
> -Toke
> 
> diff --git a/rules.mk b/rules.mk
> index 819bea5..8e1cfe9 100644
> --- a/rules.mk
> +++ b/rules.mk
> @@ -275,6 +275,7 @@ else
>    endif
>    RSTRIP:= \
Please try if changing RSTRIP:= to RSTRIP= makes it work.

>      export CROSS="$(TARGET_CROSS)" \
> +               $(if $(PKG_BUILD_ID),KEEP_BUILD_ID=1) \
>                 $(if $(CONFIG_KERNEL_KALLSYMS),NO_RENAME=1) \
>                 $(if $(CONFIG_KERNEL_PROFILING),KEEP_SYMBOLS=1); \
>      NM="$(TARGET_CROSS)nm" \
> 

- Felix
Toke Høiland-Jørgensen Oct. 30, 2015, 2:41 p.m. UTC | #2
Felix Fietkau <nbd@openwrt.org> writes:

>> diff --git a/rules.mk b/rules.mk
>> index 819bea5..8e1cfe9 100644
>> --- a/rules.mk
>> +++ b/rules.mk
>> @@ -275,6 +275,7 @@ else
>>    endif
>>    RSTRIP:= \
> Please try if changing RSTRIP:= to RSTRIP= makes it work.

Yup, it does. Cool, will submit a new patch that also includes this
change. Thanks a lot for your help! :)

-Toke
diff mbox

Patch

diff --git a/rules.mk b/rules.mk
index 819bea5..8e1cfe9 100644
--- a/rules.mk
+++ b/rules.mk
@@ -275,6 +275,7 @@  else
   endif
   RSTRIP:= \
     export CROSS="$(TARGET_CROSS)" \
+               $(if $(PKG_BUILD_ID),KEEP_BUILD_ID=1) \
                $(if $(CONFIG_KERNEL_KALLSYMS),NO_RENAME=1) \
                $(if $(CONFIG_KERNEL_PROFILING),KEEP_SYMBOLS=1); \
     NM="$(TARGET_CROSS)nm" \