Merge pull request #24 from penfold42/gcc7

GCC 7 support
This commit is contained in:
Stephen White 2018-06-17 17:45:20 +10:00 committed by GitHub
commit 4ddbb75095
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 36 additions and 17 deletions

View file

@ -29,7 +29,7 @@ $(error RASPPI must be one of: 0, 1, 2, 3)
endif endif
AFLAGS += $(ARCH) AFLAGS += $(ARCH)
CFLAGS += $(ARCH) -Wall -Wno-psabi -fsigned-char -fno-builtin -Ofast -DNDEBUG CFLAGS += $(ARCH) -Wall -Wno-unused-variable -Wno-unused-but-set-variable -Wno-psabi -fsigned-char -fno-builtin -Ofast -DNDEBUG
CPPFLAGS := $(CFLAGS) $(CPPFLAGS) -fno-exceptions -fno-rtti -std=c++0x -Wno-write-strings CPPFLAGS := $(CFLAGS) $(CPPFLAGS) -fno-exceptions -fno-rtti -std=c++0x -Wno-write-strings
CFLAGS += -fno-delete-null-pointer-checks -fdata-sections -ffunction-sections -u _printf_float -std=gnu99 CFLAGS += -fno-delete-null-pointer-checks -fdata-sections -ffunction-sections -u _printf_float -std=gnu99
@ -45,4 +45,4 @@ CFLAGS += -fno-delete-null-pointer-checks -fdata-sections -ffunction-sections -
%.o: %.cpp %.o: %.cpp
@echo " CPP $@" @echo " CPP $@"
$(Q)$(CPP) $(CPPFLAGS) $(INCLUDE) -c -o $@ $< $(Q)$(CPP) $(CPPFLAGS) $(INCLUDE) -c -o $@ $<

View file

@ -13,18 +13,25 @@ Commodore Plus4
See www.pi1541.com for SD card and hardware configurations. See www.pi1541.com for SD card and hardware configurations.
Building Toolchain Installation
-------- ----------------------
On Windows use GNU Tools ARM Embedded tool chain 5.4.1 using make. On Windows use GNU Tools ARM Embedded tool chain 5.4.1 using make.
https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads/5-2016-q2-update https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads/5-2016-q2-update
On dpkg based linux systems install: On dpkg based linux systems install:
binutils-arm-none-eabi (Tested on osmc/rpi3)
gcc-arm-none-eabi ```
libnewlib-arm-none-eabi apt-get install binutils-arm-none-eabi gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib
libstdc++-arm-none-eabi-newlib ```
On RHEL/Centos/Fedora systems follow the guide at:
https://web1.foxhollow.ca/?menu=centos7arm
(Tested on Centos7/x64 with GCC7)
https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads/7-2017-q4-major
Building
--------
``` ```
make make
``` ```

View file

@ -892,10 +892,11 @@ void FileBrowser::ShowDeviceAndROM()
char buffer[256]; char buffer[256];
u32 textColour = RGBA(0, 0, 0, 0xff); u32 textColour = RGBA(0, 0, 0, 0xff);
u32 bgColour = RGBA(0xff, 0xff, 0xff, 0xff); u32 bgColour = RGBA(0xff, 0xff, 0xff, 0xff);
u32 y = screenMain->ScaleY(STATUS_BAR_POSITION_Y); u32 x = 0; // 43 * 8
u32 y = screenMain->ScaleY(STATUS_BAR_POSITION_Y - 20);
snprintf(buffer, 256, "Device %d %s \r\n", deviceID, roms->ROMNames[roms->currentROMIndex]); snprintf(buffer, 256, "Device %d %s\r\n", deviceID, roms->ROMNames[roms->currentROMIndex]);
screenMain->PrintText(false, 43 * 8, y, buffer, textColour, bgColour); screenMain->PrintText(false, x, y, buffer, textColour, bgColour);
} }
void FileBrowser::DisplayDiskInfo(DiskImage* diskImage, const char* filenameForIcon) void FileBrowser::DisplayDiskInfo(DiskImage* diskImage, const char* filenameForIcon)

View file

@ -56,7 +56,7 @@ void _cstartup( unsigned int r0, unsigned int r1, unsigned int r2 )
while( bss < bss_end ) while( bss < bss_end )
*bss++ = 0; *bss++ = 0;
__libc_init_array(); __libc_init_array();
/* We should never return from main ... */ /* We should never return from main ... */
kernel_main( r0, r1, r2 ); kernel_main( r0, r1, r2 );

View file

@ -87,6 +87,17 @@ void _exit(int status)
} }
} }
void _fini(int status)
{
/* Stop the compiler complaining about unused variables by "using" it */
(void) status;
while (1)
{
/* TRAP HERE */
}
}
/* There's currently no implementation of a file system because there's no /* There's currently no implementation of a file system because there's no
file system! */ file system! */
int _close(int file) int _close(int file)

View file

@ -531,10 +531,10 @@ public:
invertIECInputs = value; invertIECInputs = value;
if (value) if (value)
{ {
PI_Atn = ~PI_Atn; PI_Atn = !PI_Atn;
PI_Data = ~PI_Data; PI_Data = !PI_Data;
PI_Clock = ~PI_Clock; PI_Clock = !PI_Clock;
PI_Reset = ~PI_Reset; PI_Reset = !PI_Reset;
} }
} }
@ -626,4 +626,4 @@ private:
static u32 inputRepeat[5]; static u32 inputRepeat[5];
static u32 inputRepeatPrev[5]; static u32 inputRepeatPrev[5];
}; };
#endif #endif