Hack to get rid of libstdc++
Need to setup meson build with CXX=gcc -m32 -march=pentium4 -msse2 -mfpmath=sse
This commit is contained in:
parent
3527cdfcb4
commit
758209cf98
|
@ -0,0 +1,26 @@
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
extern "C" void* emulate_cc_new(unsigned len) { \
|
||||||
|
void *p = malloc(len);
|
||||||
|
if (p == 0) {
|
||||||
|
/* Don't use stdio (e.g. fputs), because that may want to allocate more
|
||||||
|
* memory.
|
||||||
|
*/
|
||||||
|
(void)!write(2, "out of memory\n", 14);
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" void emulate_cc_delete(void* p) {
|
||||||
|
if (p != 0)
|
||||||
|
free(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
void* operator new (unsigned len) __attribute__((alias("emulate_cc_new")));
|
||||||
|
void* operator new[](unsigned len) __attribute__((alias("emulate_cc_new")));
|
||||||
|
void operator delete (void* p) __attribute__((alias("emulate_cc_delete")));
|
||||||
|
void operator delete[](void* p) __attribute__((alias("emulate_cc_delete")));
|
||||||
|
void* __cxa_pure_virtual = 0;
|
||||||
|
void* __gxx_personality_sj0 = 0;
|
|
@ -9,6 +9,7 @@ endif
|
||||||
font_renderer_sources = [
|
font_renderer_sources = [
|
||||||
'agg_font_freetype.cpp',
|
'agg_font_freetype.cpp',
|
||||||
'font_renderer.cpp',
|
'font_renderer.cpp',
|
||||||
|
'libstdcpp-replace.cpp',
|
||||||
]
|
]
|
||||||
|
|
||||||
font_renderer_cdefs = ['-DFONT_RENDERER_HEIGHT_HACK']
|
font_renderer_cdefs = ['-DFONT_RENDERER_HEIGHT_HACK']
|
||||||
|
|
|
@ -8,9 +8,10 @@ lua_dep = dependency('lua5.2', required : false)
|
||||||
lite_link_args = []
|
lite_link_args = []
|
||||||
if get_option('buildtype') == 'release'
|
if get_option('buildtype') == 'release'
|
||||||
if cc.get_id() == 'gcc'
|
if cc.get_id() == 'gcc'
|
||||||
lite_link_args += ['-static-libgcc', '-static-libstdc++']
|
lite_link_args += ['-static-libgcc'] #, '-static-libstdc++']
|
||||||
endif
|
endif
|
||||||
add_global_arguments('-fdata-sections', '-ffunction-sections', language : ['c', 'cpp'])
|
add_global_arguments('-fdata-sections', '-ffunction-sections', language : ['c', 'cpp'])
|
||||||
|
add_global_arguments('-fno-rtti', '-fno-exceptions', language : 'cpp')
|
||||||
add_global_link_arguments('-Wl,--gc-sections', language : ['c', 'cpp'])
|
add_global_link_arguments('-Wl,--gc-sections', language : ['c', 'cpp'])
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue