Fix libk being built with -mmmx, -msse and -msse2 on x86_64.

This commit is contained in:
Jonas 'Sortie' Termansen 2014-05-28 17:40:30 +02:00
parent 68d379c605
commit 534eb3ddd8
5 changed files with 10 additions and 6 deletions

View File

@ -36,7 +36,7 @@ endif
ifeq ($(CPU),x64)
X86FAMILY:=1
CXXFLAGS:=$(CXXFLAGS) -mno-red-zone
CXXFLAGS:=$(CXXFLAGS) -mno-red-zone -mno-mmx -mno-sse -mno-sse2
CPUOBJS:=$(CPU)/boot.o $(CPU)/base.o $(CPU)/x64.o
endif
@ -58,8 +58,6 @@ ifdef X86FAMILY
x86-family/pat.o \
x86-family/float.o \
x86-family/x86-family.o
# TODO: Are these -m flags even needed in the first place?
CXXFLAGS:=$(CXXFLAGS) -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow
endif
# Object files that constitute the kernel.

View File

@ -579,7 +579,7 @@ LIBK_FLAGS:=$(FLAGS) -ffreestanding
LIBK_CFLAGS:=$(CFLAGS)
LIBK_CXXFLAGS:=$(CXXFLAGS)
ifeq ($(HOST),x86_64-sortix)
LIBK_FLAGS:=$(LIBK_FLAGS) -mno-red-zone
LIBK_FLAGS:=$(LIBK_FLAGS) -mno-red-zone -mno-mmx -mno-sse -mno-sse2
endif
BINS=libc.a libdl.a libg.a libpthread.a librt.a $(CRTOBJ)

View File

@ -340,6 +340,7 @@ size_t vprintf_callback(size_t (*callback)(void*, const char*, size_t),
else
written++;
}
#if !defined(__is_sortix_kernel)
else if ( *format == 'e' || *format == 'E' ||
*format == 'f' || *format == 'F' ||
*format == 'g' || *format == 'G' ||
@ -361,6 +362,7 @@ size_t vprintf_callback(size_t (*callback)(void*, const char*, size_t),
goto unsupported_conversion;
}
#endif
else if ( *format == 'c' && (format++, true) )
{
char c;

View File

@ -1,6 +1,6 @@
/*******************************************************************************
Copyright(C) Jonas 'Sortie' Termansen 2013.
Copyright(C) Jonas 'Sortie' Termansen 2013, 2014.
This file is part of the Sortix C Library.
@ -24,7 +24,9 @@
#include <stdlib.h>
#if !defined(__is_sortix_kernel)
extern "C" double atof(const char* str)
{
return strtod(str, NULL);
}
#endif

View File

@ -1,6 +1,6 @@
/*******************************************************************************
Copyright(C) Jonas 'Sortie' Termansen 2013.
Copyright(C) Jonas 'Sortie' Termansen 2013, 2014.
This file is part of the Sortix C Library.
@ -35,6 +35,7 @@
// this will do for now. It's a temporary measure until I get around to
// writing a real strtod function - most of them are true horrors.
#if !defined(__is_sortix_kernel)
extern "C" FLOAT STRTOF(const char* str, char** nptr)
{
int sign = *str == '-' ? (str++, -1) : 1;
@ -92,3 +93,4 @@ extern "C" FLOAT STRTOF(const char* str, char** nptr)
goto out;
}
#endif