Avoid libc conflicts with libstdc++.
This commit is contained in:
parent
358f2c4524
commit
33bf0d93ad
|
@ -522,7 +522,7 @@ ifeq ($(HOST),x86_64-sortix)
|
||||||
SORTIXFLAGS:=$(SORTIXFLAGS) -mno-red-zone
|
SORTIXFLAGS:=$(SORTIXFLAGS) -mno-red-zone
|
||||||
endif
|
endif
|
||||||
|
|
||||||
BINS=libc.a libg.a libpthread.a libstdc++.a $(CRTOBJ)
|
BINS=libc.a libg.a libpthread.a $(CRTOBJ)
|
||||||
BINSKERNEL=libc-sortix.a
|
BINSKERNEL=libc-sortix.a
|
||||||
INSTALLLIBS:=$(addprefix $(DESTDIR)$(LIBDIR)/,$(BINS))
|
INSTALLLIBS:=$(addprefix $(DESTDIR)$(LIBDIR)/,$(BINS))
|
||||||
INSTALLLIBSKERNEL:=$(addprefix $(DESTDIR)$(LIBDIR)/,$(BINSKERNEL))
|
INSTALLLIBSKERNEL:=$(addprefix $(DESTDIR)$(LIBDIR)/,$(BINSKERNEL))
|
||||||
|
@ -550,9 +550,6 @@ libg.a:
|
||||||
libpthread.a:
|
libpthread.a:
|
||||||
$(HOSTAR) rcs $@
|
$(HOSTAR) rcs $@
|
||||||
|
|
||||||
libstdc++.a:
|
|
||||||
$(HOSTAR) rcs $@
|
|
||||||
|
|
||||||
crt1.o: $(CPUDIR)/crt1.o
|
crt1.o: $(CPUDIR)/crt1.o
|
||||||
ln -f $< $@
|
ln -f $< $@
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
|
|
||||||
Copyright(C) Jonas 'Sortie' Termansen 2011, 2012.
|
Copyright(C) Jonas 'Sortie' Termansen 2011, 2012, 2013.
|
||||||
|
|
||||||
This file is part of the Sortix C Library.
|
This file is part of the Sortix C Library.
|
||||||
|
|
||||||
|
@ -18,14 +18,38 @@
|
||||||
along with the Sortix C Library. If not, see <http://www.gnu.org/licenses/>.
|
along with the Sortix C Library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
aux/op-new.cpp
|
aux/op-new.cpp
|
||||||
C++ allocation operators.
|
C++ allocation operators. This is a hack to work around that libstdc++ is
|
||||||
|
yet to be integrated into Sortix.
|
||||||
|
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
void* operator new(size_t size) { return malloc(size); }
|
#if __STDC_HOSTED__
|
||||||
void* operator new[](size_t size) { return malloc(size); }
|
|
||||||
void operator delete (void* addr) { return free(addr); }
|
__attribute__((weak))
|
||||||
void operator delete[](void* addr) { return free(addr); }
|
void* operator new(size_t size)
|
||||||
|
{
|
||||||
|
return malloc(size);
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__((weak))
|
||||||
|
void* operator new[](size_t size)
|
||||||
|
{
|
||||||
|
return malloc(size);
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__((weak))
|
||||||
|
void operator delete(void* addr)
|
||||||
|
{
|
||||||
|
return free(addr);
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__((weak))
|
||||||
|
void operator delete[](void* addr)
|
||||||
|
{
|
||||||
|
return free(addr);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -114,6 +114,7 @@ logterminal.o \
|
||||||
memorymanagement.o \
|
memorymanagement.o \
|
||||||
mtable.o \
|
mtable.o \
|
||||||
net/fs.o \
|
net/fs.o \
|
||||||
|
op-new.o \
|
||||||
panic.o \
|
panic.o \
|
||||||
partition.o \
|
partition.o \
|
||||||
pci.o \
|
pci.o \
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
|
||||||
|
Copyright(C) Jonas 'Sortie' Termansen 2011, 2012, 2013.
|
||||||
|
|
||||||
|
This file is part of Sortix.
|
||||||
|
|
||||||
|
Sortix is free software: you can redistribute it and/or modify it under the
|
||||||
|
terms of the GNU General Public License as published by the Free Software
|
||||||
|
Foundation, either version 3 of the License, or (at your option) any later
|
||||||
|
version.
|
||||||
|
|
||||||
|
Sortix is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||||
|
details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License along with
|
||||||
|
Sortix. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
op-new.cpp
|
||||||
|
C++ allocation operators.
|
||||||
|
|
||||||
|
*******************************************************************************/
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
void* operator new(size_t size)
|
||||||
|
{
|
||||||
|
return malloc(size);
|
||||||
|
}
|
||||||
|
|
||||||
|
void* operator new[](size_t size)
|
||||||
|
{
|
||||||
|
return malloc(size);
|
||||||
|
}
|
||||||
|
|
||||||
|
void operator delete(void* addr)
|
||||||
|
{
|
||||||
|
return free(addr);
|
||||||
|
}
|
||||||
|
|
||||||
|
void operator delete[](void* addr)
|
||||||
|
{
|
||||||
|
return free(addr);
|
||||||
|
}
|
Loading…
Reference in New Issue