Skip to contentSkip to conversation

Signal names when cross-compiling

DISCUSSION Thorsten Otto 3 participants 4 messages Oct 4, 2023

lore
Share & tools
lore
#0 lore raw

Hi,

when cross-compiling dash, signames.c is generated by a mksignames that was compiled for the host. This will generate wrong signal mappings because obviously this will use the signal numbers of the build system, not the target.

I currently dont't have no idea how to solve that, other than populating the signal_names array at runtime rather than compile time.

#1 lore raw

Hello.

Thorsten Otto wrote in
<19502212.sIn9rWBj0N@earendil>:

 |when cross-compiling dash, signames.c is generated by a mksignames \
 |that was 
 |compiled for the host. This will generate wrong signal mappings because 
 |obviously this will use the signal numbers of the build system, not the 
 |target.
 |
 |I currently dont't have no idea how to solve that, other than populating \
 |the 
 |signal_names array at runtime rather than compile time.

Actually i have no idea, but i do have a yet unused script for signals names (that mirrors one for errors names that is in use for years. I will attach it. It is meant for the MUA i maintain (a future lib part of it) and does lots of things you surely do not need, as it is for C and C++ and creates mapping tables for by-name etc lookups, the signal documentation strings etc etc. You run it local to create the portable stuff (uses perl, and the MUA i maintain for creating hash values), and then during compile time. This compile_time() function is surely what you want, it requires some POSIX tools (awk, sort, rm) and a C compiler ($CC), actually only the preprocessing stage (much easier to let the compiler to the C preprocessor part), which' output is then parsed. Eg

TARGET=./output-file sh su-make-signals.sh compile_time

--steffen

|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)
#2 lore raw

When cross compiling you need to break the mksignames compilation apart from the rule that runs it.
You run it against you sysroot for your target arch/platform and it grabs the correct signals from the sysroot instead of the host.

Brian

-----Original Message-----
From: Steffen Nurpmeso <[email protected]>
Sent: Wednesday, October 4, 2023 1:44 PM
To: Thorsten Otto <[email protected]>
Cc: [email protected]
Subject: Re: Signal names when cross-compiling

CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.

Hello.

Thorsten Otto wrote in
<19502212.sIn9rWBj0N@earendil>:

 |when cross-compiling dash, signames.c is generated by a mksignames \  |that was  |compiled for the host. This will generate wrong signal mappings because  |obviously this will use the signal numbers of the build system, not the  |target.
 |
 |I currently dont't have no idea how to solve that, other than populating \  |the  |signal_names array at runtime rather than compile time.

Actually i have no idea, but i do have a yet unused script for signals names (that mirrors one for errors names that is in use for years. I will attach it. It is meant for the MUA i maintain (a future lib part of it) and does lots of things you surely do not need, as it is for C and C++ and creates mapping tables for by-name etc lookups, the signal documentation strings etc etc. You run it local to create the portable stuff (uses perl, and the MUA i maintain for creating hash values), and then during compile time. This compile_time() function is surely what you want, it requires some POSIX tools (awk, sort, rm) and a C compiler ($CC), actually only the preprocessing stage (much easier to let the compiler to the C preprocessor part), which' output is then parsed. Eg

TARGET=./output-file sh su-make-signals.sh compile_time

--steffen

|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off (By Robert Gernhardt)
#3 lore raw

Kuhl, Brian wrote in
<DM6PR11MB410813D5DE3610ABEB73C6F999CBA@DM6PR11MB4108.namprd11.prod.outl\
ook.com>:

 |When cross compiling you need to break the mksignames compilation apart \
 |from the rule that runs it.
 |You run it against you sysroot for your target arch/platform and it \
 |grabs the correct signals from the sysroot instead of the host.

Hä?

--steffen

|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)