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

Linux x64 support meta issue #108

Closed
23 of 25 tasks
PathogenDavid opened this issue Nov 29, 2020 · 2 comments
Closed
23 of 25 tasks

Linux x64 support meta issue #108

PathogenDavid opened this issue Nov 29, 2020 · 2 comments
Labels
Arch-x64 Issues affecting x64 platforms Area-OutputGeneration Issues concerning the process of generating output from Biohazrd Area-Transformation Issues concerning Biohazrd transformations Area-Translation Issues concerning the translation from libclang into Biohazrd Platform-Linux Issues specific to Linux

Comments

@PathogenDavid
Copy link
Member

PathogenDavid commented Nov 29, 2020

@PathogenDavid PathogenDavid added Arch-x64 Issues affecting x64 platforms Area-OutputGeneration Issues concerning the process of generating output from Biohazrd Area-Transformation Issues concerning Biohazrd transformations Area-Translation Issues concerning the translation from libclang into Biohazrd labels Nov 29, 2020
PathogenDavid added a commit that referenced this issue Jun 21, 2021
…ge of Clang's code generation module.

In short, this change replaces ClangSharpExtensions.[Record]MustBePassedByReference with ClangSharp.Pathogen.PathogenArrangedFunction, which uses Clang's code generation module to determine how a function call should be constructed. This moves Biohazrd's handling of whether a type is returned/passed by reference from TranslatedRecord to TranslatedFunction and TranslatedParameter.

This change does not include support for function pointers or vtable entries as those will require extra effort.
(VTables need to be reworked to fix #147 first. Function pointers don't support most ABI concerns in general #186.)

Fixes #35 (Fixed leaking return buffer semantics on global functions and static methods. Fixed as a side-effect.)
Contributes to #53 (Cleaning up ABI handling.)
Contributed to #108 (Linux support.)
Fixes #187 (Records with constructors not being returned by reference on Microsoft x64.)
Fixes #135 (Indirectly since this problematic method was obsoleted.)
PathogenDavid added a commit that referenced this issue Jun 21, 2021
…ge of Clang's code generation module.

In short, this change replaces ClangSharpExtensions.[Record]MustBePassedByReference with ClangSharp.Pathogen.PathogenArrangedFunction, which uses Clang's code generation module to determine how a function call should be constructed. This moves Biohazrd's handling of whether a type is returned/passed by reference from TranslatedRecord to TranslatedFunction and TranslatedParameter.

This change does not include support for function pointers or vtable entries as those will require extra effort.
(VTables need to be reworked to fix #147 first. Function pointers don't support most ABI concerns in general #186.)

Fixes #35 (Fixed leaking return buffer semantics on global functions and static methods. Fixed as a side-effect.)
Contributes to #53 (Cleaning up ABI handling.)
Contributes to #108 (Linux support.)
Fixes #187 (Records with constructors not being returned by reference on Microsoft x64.)
Fixes #135 (Indirectly since this problematic method was obsoleted.)
PathogenDavid added a commit that referenced this issue Jul 4, 2021
…ge of Clang's code generation module.

In short, this change replaces ClangSharpExtensions.[Record]MustBePassedByReference with ClangSharp.Pathogen.PathogenArrangedFunction, which uses Clang's code generation module to determine how a function call should be constructed. This moves Biohazrd's handling of whether a type is returned/passed by reference from TranslatedRecord to TranslatedFunction and TranslatedParameter.

This change does not include support for function pointers or vtable entries as those will require extra effort.
(VTables need to be reworked to fix #147 first. Function pointers don't support most ABI concerns in general #186.)

Fixes #35 (Fixed leaking return buffer semantics on global functions and static methods. Fixed as a side-effect.)
Contributes to #53 (Cleaning up ABI handling.)
Contributes to #108 (Linux support.)
Fixes #187 (Records with constructors not being returned by reference on Microsoft x64.)
Fixes #135 (Indirectly since this problematic method was obsoleted.)
PathogenDavid added a commit that referenced this issue Jul 5, 2021
…ge of Clang's code generation module.

In short, this change replaces ClangSharpExtensions.[Record]MustBePassedByReference with ClangSharp.Pathogen.PathogenArrangedFunction, which uses Clang's code generation module to determine how a function call should be constructed. This moves Biohazrd's handling of whether a type is returned/passed by reference from TranslatedRecord to TranslatedFunction and TranslatedParameter.

This change does not include support for function pointers or vtable entries as those will require extra effort.
(VTables need to be reworked to fix #147 first. Function pointers don't support most ABI concerns in general #186.)

Fixes #35 (Fixed leaking return buffer semantics on global functions and static methods. Fixed as a side-effect.)
Contributes to #53 (Cleaning up ABI handling.)
Contributes to #108 (Linux support.)
Fixes #187 (Records with constructors not being returned by reference on Microsoft x64.)
Fixes #135 (Indirectly since this problematic method was obsoleted.)
@PathogenDavid PathogenDavid added the Platform-Linux Issues specific to Linux label Jul 6, 2021
PathogenDavid added a commit that referenced this issue Jul 9, 2021
@PathogenDavid
Copy link
Member Author

Details on adding support for the ELF tests on Windows:

I ran some tests on Alloy (See the MakeSharedLibraryElfWindows playground) and we can use the Visual Studio-provided Clang to build a Linux ELF shared library with some tweaks to our command:

  • Add -fuse-ld=lld to make it use lld instead of trying (and failing) to use ld
  • Add --no-standard-libraries to avoid having it trying to link to glibc and such (we don't need them for these tiny test libraries

Since the --no-standard-libraries thing is very atypical, we should not add that unconditionally on Linux.


Additionally we need to use the Visual Studio setup API to locate the an install which has the LLVM toolset component installed.


The skeleton of the logic is already there, but I think we should implement things such that the tests are skipped on Windows if Clang is not installed except if we're running on CI. (That way we don't have to make people install a huge toolset they won't usually be using.)


One thing that is less clear is how to handle skipping these tests if we end up merging the two LinkImportsTransformation tests into one. XUnit doesn't support dynamic skipping until the new release is finished.

@PathogenDavid
Copy link
Member Author

Linux support is now live in main 🎉

The remaining work items above are covered by their own issues and aren't strictly required to use Biohazrd with Linux so I'm closing this issue.

@PathogenDavid PathogenDavid unpinned this issue Dec 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arch-x64 Issues affecting x64 platforms Area-OutputGeneration Issues concerning the process of generating output from Biohazrd Area-Transformation Issues concerning Biohazrd transformations Area-Translation Issues concerning the translation from libclang into Biohazrd Platform-Linux Issues specific to Linux
Projects
None yet
Development

No branches or pull requests

1 participant