Fix optimized builds emitting SSE code

This commit is contained in:
flysand7 2023-08-04 06:20:24 +11:00
parent 845d08ee3a
commit 246e9f2071
2 changed files with 17 additions and 2 deletions

View File

@ -269,11 +269,26 @@ cia_lib = f'lib/{lib_file}'
crt_lib = f'lib/{crt_file}' crt_lib = f'lib/{crt_file}'
dl_lib = f'lib/{dl_file}' dl_lib = f'lib/{dl_file}'
dl_flags = [
'-shared',
'-nostdlib',
'-mno-sse',
'-ffreestanding',
'-fno-stack-protector',
'-Wl,-e,_dlstart',
'-Wl,--sort-section,alignment',
'-Wl,--sort-common',
'-Wl,--gc-sections',
'-Wl,--hash-style=both',
'-Wl,--no-undefined',
'-Wl,--exclude-libs=ALL',
]
if target == 'linux': if target == 'linux':
print_step(f'Compiling {dl_lib}\n') print_step(f'Compiling {dl_lib}\n')
assemble('src/loader/loader-entry.asm', 'bin/loader-entry.o') assemble('src/loader/loader-entry.asm', 'bin/loader-entry.o')
compile(['bin/loader-entry.o', 'src/loader/loader-self-reloc.c', 'src/loader/loader.c'], dl_lib, compile(['bin/loader-entry.o', 'src/loader/loader-self-reloc.c', 'src/loader/loader.c'], dl_lib,
'-ffreestanding -shared -nostdlib -Wl,-e,_dlstart -Wl,--sort-section,alignment -Wl,--sort-common -Wl,--gc-sections -Wl,--hash-style=both -Wl,--no-undefined -Wl,--exclude-libs=ALL -fno-stack-protector') ' '.join(dl_flags))
print_step(f'Compiling {crt_file}\n') print_step(f'Compiling {crt_file}\n')
if target == 'linux': if target == 'linux':

View File

@ -116,7 +116,7 @@ static void printf(char *fmt, ...) {
va_end(args); va_end(args);
} }
#if defined(_DEBUG) #if defined(_DEBUG) || 1
#define _dbg_print_char(c) print_char(c) #define _dbg_print_char(c) print_char(c)
#define _dbg_print_string(s) print_string(s) #define _dbg_print_string(s) print_string(s)
#define _dbg_print_string_n(s,n) print_string_n(s,n) #define _dbg_print_string_n(s,n) print_string_n(s,n)