Thanks to visit codestin.com
Credit goes to lwn.net

|
|
Log in / Subscribe / Register

SPDX identifiers in the kernel

SPDX identifiers in the kernel

Posted Dec 7, 2017 11:51 UTC (Thu) by cbcbcb (subscriber, #10350)
Parent article: SPDX identifiers in the kernel

It seems a shame that these identifiers are written as comments. With appropriate macro definitions you could have

    #include "spdx.h"

    SPDX_LICENCE_IDENTIFIER("GPL-2.0")
And with appropriate definitions, the licence information could be propagated into object and executable files too. This would be useful, as it takes effort to establish which source files have been used in a build, and therefore which licences apply to your binaries.


to post comments

SPDX identifiers in the kernel

Posted Dec 7, 2017 11:59 UTC (Thu) by gregkh (subscriber, #8) [Link] (1 responses)

It's a common idea, but it doesn't really work well for .h files.

Also, what happens when you combine multiple .c files into a single .o file?

It gets messy very quickly, we tried it. Hence the fall-back to a comment, which works out much better

SPDX identifiers in the kernel

Posted Dec 7, 2017 13:40 UTC (Thu) by nix (subscriber, #2304) [Link]

It works even less well for languages other than C and languages that have nothing like the preprocessor -- but almost any language you can name has comments.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds