There are similar tools in https://github.com/richfelker/musl-chartable-tools …, but one particular thing I chose to do differently was not to put the outer declaration/braces inside the output file. Instead you #include it between the braces.
-
-
Replying to @RichFelker @sortiecat
why not objcopy (generate the ELF directly), xxd --include and such. Why reinvent existing thing? At least grab their relevant piece of code, or stick to their syntax people already know.
1 reply 0 retweets 0 likes -
Replying to @elazarl @sortiecat
There are very very good reasons not to do the objcopy stuff. It's an awful hack that should be forgotten except as reminder not to reinvent it.
1 reply 0 retweets 2 likes -
Replying to @RichFelker @sortiecat
Can you please explain more? I liked the idea, since the old C compiler collapsed when I gave him a very long static array. Resorted to asm .data
1 reply 0 retweets 0 likes -
Replying to @elazarl @sortiecat
Asm .data is less awful than objcopy, but still nonportable and inherently hides the content of the data from the compiler (preventing static analysis of correctness aspects and value range based optimization).
1 reply 1 retweet 1 like -
Can't find the thread at the moment, but it was recently discussed that huge array blows up gcc's ast but huge string avoids it. Ugly but works.
2 replies 0 retweets 0 likes -
I should say huge initializer list rather than single string-literal initializer. It's an array either way.
1 reply 0 retweets 0 likes -
Replying to @RichFelker @sortiecat
So the problem is objcopy hiding the content from the compiler? Why? What about LTO? Why does it matter for a big static array? Which optimizations do you expect?
2 replies 0 retweets 0 likes -
Replying to @elazarl @sortiecat
For objcopy the problem is bigger than asm .data: gratuitous dependency on a particular toolchain. Won't work on a llvm-only one, much less more exotic ones.
1 reply 0 retweets 0 likes -
Replying to @RichFelker @sortiecat
Um... Isn't depending on C array or xxd much worse?
1 reply 0 retweets 0 likes
No, and you can ship the output because it's not target-dependent.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.