diff --git a/contrib/sdk/sources/newlib/app.lds b/contrib/sdk/sources/newlib/app.lds index 9054b2027..41e3041f2 100644 --- a/contrib/sdk/sources/newlib/app.lds +++ b/contrib/sdk/sources/newlib/app.lds @@ -79,12 +79,12 @@ SECTIONS ___iend = . ; } -/* .eh_frame BLOCK(16) : + .eh_frame BLOCK(16) : { PROVIDE (___EH_FRAME_BEGIN__ = .) ; *(.eh_frame*) } -*/ + .idata ALIGN(16): { __idata_start = .; @@ -120,7 +120,6 @@ SECTIONS *(.drectve) *(.note.GNU-stack) *(.comment) - *(.eh_frame) *(.debug_abbrev) *(.debug_info) *(.debug_line) diff --git a/contrib/sdk/sources/newlib/libc/Makefile b/contrib/sdk/sources/newlib/libc/Makefile index 762d04f1d..42f82b578 100644 --- a/contrib/sdk/sources/newlib/libc/Makefile +++ b/contrib/sdk/sources/newlib/libc/Makefile @@ -3,7 +3,7 @@ CC = kos32-gcc AR = kos32-ar LD = kos32-ld -CFLAGS = -c -O2 -fno-ident -fomit-frame-pointer -fexceptions -DBUILD_DLL -DMISSING_SYSCALL_NAMES +CFLAGS = -c -O2 -fno-ident -fomit-frame-pointer -fexceptions -DMISSING_SYSCALL_NAMES LDFLAGS = -shared -s -T libcdll.lds --out-implib libc.dll.a --image-base 0 #LDFLAGS+= --output-def libc.orig.def ARFLAGS = crs @@ -15,7 +15,7 @@ LIBC_INCLUDES = $(LIBC_TOPDIR)/include NAME:= libc -DEFINES:= -D_IEEE_LIBM -DHAVE_RENAME +DEFINES:= -D_IEEE_LIBM -DHAVE_RENAME -DBUILD_LIBC INCLUDES:= -I $(LIBC_INCLUDES) diff --git a/contrib/sdk/sources/newlib/libc/app.lds b/contrib/sdk/sources/newlib/libc/app.lds index b98ae836f..2aa84c3f5 100644 --- a/contrib/sdk/sources/newlib/libc/app.lds +++ b/contrib/sdk/sources/newlib/libc/app.lds @@ -46,6 +46,18 @@ SECTIONS ___RUNTIME_PSEUDO_RELOC_LIST_END__ = .; __RUNTIME_PSEUDO_RELOC_LIST_END__ = .; } + + .eh_frame ALIGN(16) : + + { + + ___EH_FRAME_BEGIN___ = .; + *(.eh_frame*); + __EH_FRAME_END__ = .; + + + } + .CRT ALIGN(16) : { ___crt_xc_start__ = . ; @@ -113,7 +125,6 @@ SECTIONS *(.debug$F) *(.drectve) *(.note.GNU-stack) - *(.eh_frame) *(.comment) *(.debug_abbrev) *(.debug_info) diff --git a/contrib/sdk/sources/newlib/libc/include/newlib.h b/contrib/sdk/sources/newlib/libc/include/newlib.h index 34700e04e..7dcdf6d18 100644 --- a/contrib/sdk/sources/newlib/libc/include/newlib.h +++ b/contrib/sdk/sources/newlib/libc/include/newlib.h @@ -169,5 +169,17 @@ /* #undef _ICONV_FROM_ENCODING_WIN_1257 */ /* #undef _ICONV_FROM_ENCODING_WIN_1258 */ +#ifdef STATIC_LIBC + #define BUILD_LIBC +#endif + +#ifdef BUILD_LIBC + #define __EXPORT + #define __IMPORT +#else + #define __EXPORT __attribute__ ((dllexport)) + #define __IMPORT __attribute__ ((dllimport)) +#endif + #endif /* !__NEWLIB_H__ */