设置许可证的Linux内核模块 [英] Setting the license for modules in the linux kernel
问题描述
我已经写在阿达一些内核模块,我已经打了一个有点问题。许可证被定义为一个C宏,我想不通,它实际上是什么。它是一个合适的解决方案,只是有一些C再出口需要GPL如果这两个c和ADA模块有GPL兼容许可证的所有C函数?有没有更好的方式来做到这一点?
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?
推荐答案
与C宏处理是皇室PITA。我有一个梦想,有一天C程序员会做世界青睐的休息和使用他们戒烟。
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.
如果是我的话,我会运行宏来看看它的输出,然后写一些阿达code输出等价的。
If it were me, I'd run the macro to see what it outputs, then write some Ada code to output the equivalent.
从通过Roland的答案读,它看起来对我来说,实现定义编译linker_section 可能需要
From reading through Roland's answer, it looks to me like the implementation-defined pragma linker_section may be required.
编译Linker_Section([实体=>] LOCAL_NAME,[科=>]
static_string_EX preSSION);
pragma Linker_Section ( [Entity =>] LOCAL_NAME, [Section =>] static_string_EXPRESSION);
LOCAL_NAME必须指被在库中声明的对象
水平。该编译指定的连接器部分的名称
给定的实体。它等同于 __在GNU C属性__((部分))
并导致LOCAL_NAME被放置在static_string_EX preSSION
可执行文件的部分(假设链接器不重命名
部分)。
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).
这篇关于设置许可证的Linux内核模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!