New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use -fvisibility=hidden with c objects can not compile #2922
Comments
Sure, we have nothing better to do with our spare time. I don't recall a single piece of D source you provided in any of your issues so far, so maybe it should be you providing some code. I don't mean to be too rude, but this kind of issues (hey, I'm using some cmdline switch I don't really understand, and it's not working) aren't helpful (and I'm quite sure the problem isn't LDC). |
In case you're fwd declaring C functions to be linked in from other shared libs (sqlite etc.) yourself, i.e., not importing them from a 3rd party module, and only using those functions inside that module (compiled with the new switch), you might currently need to fwd declare them as |
Hmm, seems like |
=> #2923 |
sorry, here is the example I test not work.
module hidden1;
extern(C) int printf(const(char)*, ...);
void test(){
printf("%d", 123);
}
import hidden1;
extern(C) void main(){
test();
} This also not work: I understand the link shared c lib should be use with export, but I think the inner sub module should not ask for export. If we need to export every cross module ref to made it compile, then it is not useful in most case. or people need force to merge every module into one. And please consider to do we need support use Makefile to compile each module into object and link them together late. and maybe explain if we support this or not in the documentation or changelog. |
I figured the issue; the feature is really unusable as it is in beta2, but fixed in the PR. So thx, your report did help, but it's just considerably more work if I have to study the code to form a hypothesis & come up with a testcase myself. |
Understood, I will try provide test case to help reduce the work in future issues. |
For example I build sqlite object file with D source into so (-shared -fvisibility=hidden), result with undefined reference to `abort' and all sqlite symbols. remove -fvisibility=hidden it can build and pass test.
I try add -L-lc, still report missing symbols. (test on android termux arm32).
please provide example how it work with c static lib or object files.
The text was updated successfully, but these errors were encountered: