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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
7eb0e43
to
898e6ca
Compare
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:
bin
directory andlibgcc.a
from thelib
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
PATH
environment variable to point to thebin
directory for the new toolsPREFIX
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.