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

Duplicated definitions on generated code #2356

Closed
mingodad opened this issue Nov 6, 2022 · 4 comments
Closed

Duplicated definitions on generated code #2356

mingodad opened this issue Nov 6, 2022 · 4 comments

Comments

@mingodad
Copy link
Contributor

mingodad commented Nov 6, 2022

When trying to build https://github.com/GaloisInc/cclyzerpp with the latest souffle I was getting several link time errors see here GaloisInc/cclyzerpp#141 due to duplicated symbols at link time when trying to use more than one souffle generated sources in the same application/library.

But using the exact souffle-2.3 builds without problems, probably a regression or unintended changes happened ?

@ruricolist
Copy link
Contributor

We're seeing the same problem with ddisasm. The change is that since 4008db6 Souffle separates definitions out of declarations. This means the definitions are no longer implicitly declared inline and the linker won't allow multiple compiled Souffle outputs to be linked together.

@mingodad
Copy link
Contributor Author

mingodad commented Nov 7, 2022

Hello @ruricolist can you make a pull request ?
Looking through your repository it seems that you have a fix for this.

@quentin
Copy link
Member

quentin commented Nov 10, 2022

As part of a larger set of changes, I added an option to specify a namespace for the generated code so that several programs may be instanciated: quentin@2f86f7b

I might progressively contribute the branch in a near future.

@ruricolist
Copy link
Contributor

ruricolist commented Nov 14, 2022

In the meantime this patch can be used to allow Souffle to output files that can be compiled and linked: master...ruricolist:souffle:master

Note that either way, executables generated by linking multiple Souffle files will now be much larger (because the linker can no longer eliminate duplicate methods).

Edit: ruricolist@1ac5e27 is preferable to the above (it is deterministic).

ruricolist added a commit to ruricolist/souffle that referenced this issue Dec 2, 2022
ruricolist added a commit to ruricolist/souffle that referenced this issue Dec 2, 2022
ruricolist added a commit to ruricolist/souffle that referenced this issue Dec 2, 2022
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

No branches or pull requests

3 participants