Skip to content
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

wasm needs targettype to be sourceLibrary #27

Merged
merged 1 commit into from
Jun 16, 2019

Conversation

skoppe
Copy link
Contributor

@skoppe skoppe commented Jun 16, 2019

Otherwise lld won't link it correctly with the dependant. For templates it is not an issue, but for regular functions it is.

@9il
Copy link
Member

9il commented Jun 16, 2019

LGTM

@wilzbach wilzbach merged commit d5e6196 into dlang-community:master Jun 16, 2019
@skoppe
Copy link
Contributor Author

skoppe commented Jun 24, 2019

Hmm. It appears what I wrote above is not true. It does fix the problem I was having (unresolved references), but it should be considered a workaround at best.

You see, I recently started using dip1000 in spasm, and suddenly I got an unresolved reference for the BitVector.rep function defined in bitmapped_block.d.

Because BitmappedBlock is a template it was instantiated with the compiler flags of spasm (which includes dip1000), and it inferred an extra return attribute on the BitVector.rep function, causing the mangling to be different vs. the BitVector.rep function in the static compiled library. (I am using dub).

The proper solution (in my case) would be to compile stdx-allocator with dip1000, but that would probably cause issues for dependent projects that don't do dip1000...

@9il
Copy link
Member

9il commented Jun 25, 2019

I think the allocators should be a source library. To solve similar issues in Mir I reworked structs and their methods as templated structs/methods.

@skoppe
Copy link
Contributor Author

skoppe commented Jun 25, 2019

I don't think it scales so well to have every library that uses different compiler flags to be a sourceLibrary. Plus, I need the dip1000 for unittests as well.

It also seems an issue more and more people will run into when using more dip switches.

I don't have a good solution for this. It could be argued to be a dub issue that it doesn't propagate the compiler switches when compiling dependencies. But I reckon that propagating switches to come with drawbacks as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants