C0deH4cker / PwnableHarness

Manage building and deploying exploitation challenges with ease
MIT License
57 stars 4 forks source link

Allow parallel compilation with `-flto` #63

Open C0deH4cker opened 2 days ago

C0deH4cker commented 2 days ago

When linking an executable using link-time optimization, I saw this warning message printed:

lto-wrapper: warning: using serial compilation of 2 LTRANS jobs lto-wrapper: note: see the '-flto' option documentation for more information

After researching, I found this Stack Overflow answer talking about this message: https://stackoverflow.com/a/72222512

It seems that this happens when GCC doesn't detect a running make job server. This makes sense in the current setup, as GCC is run in a separate Docker container without access to environment variables and make's named pipe for the job server.

This issue tracks investigating whether it's possible to allow GCC in Docker access to make's job server somehow, and enable it if possible.

As a side-note, it might be worth looking into whether the pwncc container could instead run as a server. This would enable PwnableHarness to request the pwncc server to run specific compile commands, rather than needing to create and destroy a new Docker container with every command.