BartmanAbyss / vscode-amiga-debug

One-stop Visual Studio Code Extension to compile, debug and profile Amiga C/C++ programs compiled by the bundled gcc 12.2 with the bundled WinUAE/FS-UAE.
GNU General Public License v3.0
312 stars 39 forks source link

Strip during install rather than during cleanup #109

Closed petmac closed 2 years ago

petmac commented 2 years ago

I haven't updated the Windows instructions in the README as I haven't verified that it works on Windows.

It looks fine for Linux though. I downloaded the artifacts from a previous run without these changes, and a run with these changes, and compared them.

All the executables seem to be the same size, so stripped.

There are a couple of .a files, which now do not get stripped. I think this is the correct behaviour, and we were stripping these unnecessarily.

If you have time, would you be able to try the changes on Windows?

BartmanAbyss commented 2 years ago

How would I try these changes on Windows? You mean WSL? There are still the problems that the makefile doesn't append .exe when it tries to run the cross-compiled gcc to get its spec-file.

petmac commented 2 years ago

Ah yes, sorry, I forgot about that. Never mind.

If I understand correctly, there are a couple of potential solutions to the problem of missing .exe, which I believe is due to the build process looking for Linux binaries, when it has only built MinGW binaries.

The first is to build natively on Windows, which I expect is an absolute nightmare.

The second is to build what I think is called a "Canadian cross-compiler", which means you build on Linux (or WSL), with host = Windows and target = Amiga, but rather than try to run programs which are not for your machine's architecture, you build things in the correct order so the required programs have just been built:

  1. Configure, build and install native binutils targeting Windows
  2. Configure, build and install native GCC targeting Windows (uses binutils from previous step)
  3. Configure, build and install binutils-gdb for Windows targeting Amiga (uses everything from previous steps)
  4. Configure, build and install GCC for Windows targeting Amiga (uses everything from previous steps)

Again, an absolute nightmare.

BartmanAbyss commented 2 years ago

Yeah, I just spent 2 hours trying to get the compile running without the workarounds I had previously, and I have now given up. Good enough, I think ;)

petmac commented 2 years ago

Thanks.

I've similarly burned hours trying to get GCC to build for Mac. I haven't yet succeeded.