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

Question about object files location #78

Open
miquecg opened this issue Aug 4, 2023 · 0 comments
Open

Question about object files location #78

miquecg opened this issue Aug 4, 2023 · 0 comments

Comments

@miquecg
Copy link

miquecg commented Aug 4, 2023

Hi,

This is more of a question rather than an issue with port_compiler itself 🙂

I'm working on an Erlang project that relies on C code for one application. After successfully compiling code there are a bunch of artifacts and files created on two locations:

  • c_src
    • foo.d
    • foo.o
  • priv
    • foo.so

I'm wondering if foo.o could be created also on priv directory or any other location for that matter. I'm also wondering if I could tweak flags to produce foo.so only. Not that I'm very familiar with gcc or C code itself.

This is for caching purposes in the context of a Dockerfile with different steps for compiling and assembling releases. Basically I assumed that caching the final shared object after compilation would be enough, but it turns out that without the other *.o file compilation and linking gets triggered again when assembling a release. My first idea was to also generate that object file inside priv (already cached) but I didn't manage to find a way to do so. In the end something as simple as creating an empty foo.o file was enough to avoid that unnecessary extra compilation and linking, albeit very minor to be fair.

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

1 participant