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

Add Linux support to InlineExportHelper #209

Open
PathogenDavid opened this issue Aug 5, 2021 · 3 comments
Open

Add Linux support to InlineExportHelper #209

PathogenDavid opened this issue Aug 5, 2021 · 3 comments
Labels
Concept-InlineExpectation Issues concerning problems around C++'s expectation for something to be inlined. Platform-Linux Issues specific to Linux

Comments

@PathogenDavid
Copy link
Member

InlineExportHelper is currently very Windows-centric. The strategy for forcing exports with GCC/Clang targeting Linux is actually quite a bit simpler from some preliminary tests.

Our function pointer export already works the same for functions/normal methods. The linker pragma is not necessary (and probably has no equivalent.)

Unlike with Windows, we do not need to call via trampolines to call inline constructors/destructors. Simply calling them somewhere in dummy code will cause them to appear in the export table. For example, this function declaration will cause the based object constructor and base object destructor to be exported:

__attribute__((visibility("hidden"))) void __BiohazrdForceExportOfConstructors()
{
    delete new TestClass2();
    delete new TestClass3();
}

Still need to do some more research on how to cause the other kinds of constructors/destructors to be exported.

@PathogenDavid PathogenDavid added Concept-InlineExpectation Issues concerning problems around C++'s expectation for something to be inlined. Platform-Linux Issues specific to Linux labels Aug 5, 2021
PathogenDavid added a commit that referenced this issue Aug 5, 2021
@PathogenDavid
Copy link
Member Author

PathogenDavid commented Aug 5, 2021

This would be useful here: #211

@PathogenDavid
Copy link
Member Author

Added bare minimum support in da037f7. Would like to transition from trampolines to exporting constructors/destructors via dummy calls instead though.

@PathogenDavid
Copy link
Member Author

Note that doing this without trampolines is blocked by getting the correct mangling for Itanium destructors since the trampolines are hiding this issue. (#210 and #159 are somewhat related.)

PathogenDavid added a commit that referenced this issue Aug 26, 2021
PathogenDavid added a commit that referenced this issue Oct 31, 2021
…when generating for Itanium targets.

Relates to #209
PathogenDavid added a commit that referenced this issue Oct 31, 2021
…when generating for Itanium targets.

Relates to #209
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Concept-InlineExpectation Issues concerning problems around C++'s expectation for something to be inlined. Platform-Linux Issues specific to Linux
Projects
None yet
Development

No branches or pull requests

1 participant