Setting the license for modules in the linux kernel
ada, c, linux-kernel
Solution
Dealing with C macros is a royal PITA. I have a dream that one day C programmers will do the rest of the world a favor and quit using them.
If it were me, I'd run the macro to see what it outputs, then write some Ada code to output the equivalent.
From reading through Roland's answer, it looks to me like the implementation-defined pragma linker_section may be required.
pragma Linker_Section ( [Entity =>] LOCAL_NAME, [Section =>] static_string_EXPRESSION);
LOCAL_NAME must refer to an object that is declared at the library level. This pragma specifies the name of the linker section for the given entity. It is equivalent to `__attribute__((section))` in GNU C and causes LOCAL_NAME to be placed in the static_string_EXPRESSION section of the executable (assuming the linker doesn't rename the section).
Problem
I've written some kernel modules in Ada, and I've hit a bit of a problem. License is defined as a c macro, and I can't work out what it actually is. Is it a suitable solution to simply have some c re-exporting all the c functions which require GPL if both the c and the ada module have GPL compatible licenses? Is there a better way to do this?