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

Easier support for cross compiled GCC tools under Windows #325

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

iratahack
Copy link
Contributor

@iratahack iratahack commented Apr 15, 2024

Minimize differences between the Windows and Linux setup to allow easier integration of separate gcc toolsets.

Windows environment will continue to work the same but allows different versions of gcc to be used by:

  1. removing the gcc (and associated tools) from the bin directory and libgcc.a from the lib directory, e.g. bin/ar.exe bin/as.exe bin/cc1.exe bin/cpp.exe bin/gcc.exe bin/gdb.exe bin/ld.exe bin/libgcc_s_dw2-1.dll bin/libgmp-10.dll bin/libiconv-2.dll bin/liblto_plugin-0.dll bin/libmpc-3.dll bin/libmpfr-4.dll bin/lto-wrapper.exe bin/lto1.exe bin/nm.exe bin/objcopy.exe bin/objdump.exe bin/size.exe lib/libgcc.a
  2. setting the PATH environment variable to point to the bin directory for the new tools
  3. setting the PREFIX environment variable to match the tools being used, e.g. m68k-elf-

A better solution would be to isolate the GCC tools into their own directory removing the need for item 1. above. Users would only need to set their PATH to point to their own or SGDK supplied GCC tools.

Copy link
Contributor Author

@iratahack iratahack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be ready to go.

@@ -168,7 +168,7 @@ $(OUT)/symbol.txt: $(OUT)/rom.out

$(OUT)/rom.out: $(OUT)/sega.o $(OUT)/cmd_ $(LIBMD)
$(MKDIR) -p $(dir $@)
$(CC) -m68000 -B$(BIN) -n -T $(GDK)/md.ld -nostdlib $(OUT)/sega.o @$(OUT)/cmd_ $(LIBMD) $(LIBGCC) -o $(OUT)/rom.out -Wl,--gc-sections -flto
$(CC) -m68000 -B$(BIN) -n -T $(GDK)/md.ld -nostdlib $(OUT)/sega.o @$(OUT)/cmd_ -L$(LIB) $(LIBMD) $(LIBGCC) -o $(OUT)/rom.out -Wl,--gc-sections -flto
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use -L to set the library path. This allows libgcc.a to be picked up from the SGDK/lib directory if it exists or the default GCC lib directory if it doesn't.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minimize the differences between Windows and Linux. The .exe extension isn't needed.

@@ -2,50 +2,34 @@

BIN := $(GDK)/bin
LIB := $(GDK)/lib
export PATH := $(BIN):$(PATH)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set the path to include the SGDK/bin directory.

@iratahack iratahack force-pushed the master branch 3 times, most recently from 7eb0e43 to 898e6ca Compare May 21, 2024 20:57
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

Successfully merging this pull request may close these issues.

None yet

1 participant