Merge pull request #102 from ginggs/kfreebsd-hurd

Build on GNU/kfreeBSD and GNU/Hurd
This commit is contained in:
Viral B. Shah 2015-11-12 11:20:11 +05:30
commit a8c2f3a1bb
70 changed files with 85 additions and 100 deletions

View file

@ -82,37 +82,22 @@ override OS=WINNT
endif
#keep these if statements separate
ifeq ($(OS), WINNT)
SHLIB_EXT = dll
SONAME_FLAG = -soname
CFLAGS_add += -nodefaultlibs
shlibdir = $(bindir)
else
shlibdir = $(libdir)
endif
ifeq ($(OS), Linux)
SHLIB_EXT = so
SONAME_FLAG = -soname
CFLAGS_add+=-fPIC
endif
ifeq ($(OS), FreeBSD)
SHLIB_EXT = so
SONAME_FLAG = -soname
CFLAGS_add+=-fPIC
endif
ifeq ($(OS), OpenBSD)
SHLIB_EXT = so
SONAME_FLAG = -soname
CFLAGS_add+=-fPIC
endif
ifeq ($(OS), Darwin)
SHLIB_EXT = dylib
SONAME_FLAG = -install_name
CFLAGS_add+=-fPIC
SHLIB_EXT = dll
SONAME_FLAG = -soname
override CFLAGS_add += -nodefaultlibs
shlibdir = $(bindir)
else
ifeq ($(OS), Darwin)
SHLIB_EXT = dylib
SONAME_FLAG = -install_name
else
SHLIB_EXT = so
SONAME_FLAG = -soname
endif
override CFLAGS_add += -fPIC
shlibdir = $(libdir)
endif
# The target specific FLAGS_add

View file

@ -62,7 +62,7 @@
#define _START_ENTRY .p2align 4,0x90
#if defined(__linux__) || defined(__FreeBSD__) || defined(__ELF__)
#if defined(__ELF__)
#define _ENTRY(x) .text; _START_ENTRY; \
.globl CNAME(x); .type CNAME(x),@function; CNAME(x):
#define END(x) .size x, . - x

View file

@ -25,6 +25,6 @@ ENTRY(remainder)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -24,6 +24,6 @@ ENTRY(remainderf)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -30,6 +30,6 @@ ENTRY(remainderl)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -35,6 +35,6 @@ END(sqrt)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -34,6 +34,6 @@ END(sqrtf)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -41,6 +41,6 @@ ENTRY(sqrtl)
ret
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -7,6 +7,6 @@ ENTRY(llrint)
END(llrint)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -7,6 +7,6 @@ ENTRY(llrintf)
END(llrintf)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -40,6 +40,6 @@ ENTRY(llrintl)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -24,6 +24,6 @@ ENTRY(logbl)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -39,6 +39,6 @@ END(lrint)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -39,6 +39,6 @@ END(lrintf)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -40,6 +40,6 @@ ENTRY(lrintl)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -71,6 +71,6 @@ END(remquo)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -71,6 +71,6 @@ END(remquof)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -76,6 +76,6 @@ ENTRY(remquol)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -21,6 +21,6 @@ ENTRY(rintl)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -50,6 +50,6 @@ END(scalbn)
.set CNAME(ldexp),CNAME(scalbn)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -50,6 +50,6 @@ END(scalbnf)
.set CNAME(ldexpf),CNAME(scalbnf)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -35,6 +35,6 @@ END(scalbnl)
.set CNAME(ldexpl),CNAME(scalbnl)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -39,7 +39,7 @@
#if defined(__APPLE__)
#include "osx_asm.h"
#define CNAME(x) EXT(x)
#elif defined(__FreeBSD__) || defined(__linux__) || defined(_WIN32)
#else
#include "bsd_cdefs.h"
#ifdef PIC
@ -72,7 +72,7 @@
/* XXX should use .p2align 4,0x90 for -m486. */
#define _START_ENTRY .p2align 2,0x90
#if defined(__linux__) || defined(__FreeBSD__) || defined(__ELF__)
#if defined(__ELF__)
#define CNAME(csym) csym
#define HIDENAME(asmsym) .asmsym
#define _ENTRY(x) .text; _START_ENTRY; \

View file

@ -71,6 +71,6 @@ END(exp)
//
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -20,6 +20,6 @@ END(fmod)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -16,6 +16,6 @@ END(log)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -16,6 +16,6 @@ END(log10)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -17,6 +17,6 @@ END(log10f)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -16,6 +16,6 @@ ENTRY(logf)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -20,6 +20,6 @@ END(remainder)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -21,6 +21,6 @@ END(remainderf)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -20,6 +20,6 @@ ENTRY(remainderl)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -15,6 +15,6 @@ END(sqrt)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -16,6 +16,6 @@ END(sqrtf)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -14,6 +14,6 @@ ENTRY(sqrtl)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -29,6 +29,6 @@ END(ceil)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -31,6 +31,6 @@ END(ceilf)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -29,6 +29,6 @@ END(ceill)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -20,6 +20,6 @@ END(copysign)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -21,6 +21,6 @@ END(copysignf)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -19,6 +19,6 @@ END(copysignl)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -28,6 +28,6 @@ END(cos)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -30,6 +30,6 @@ END(floor)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -31,6 +31,6 @@ END(floorf)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -29,6 +29,6 @@ END(floorl)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -38,6 +38,6 @@ END(llrint)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -38,6 +38,6 @@ END(llrintf)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -37,6 +37,6 @@ ENTRY(llrintl)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -16,6 +16,6 @@ END(logb)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -17,6 +17,6 @@ END(logbf)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -15,6 +15,6 @@ ENTRY(logbl)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -37,6 +37,6 @@ END(lrint)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -37,6 +37,6 @@ END(lrintf)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -36,6 +36,6 @@ ENTRY(lrintl)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -64,6 +64,6 @@ END(remquo)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -64,6 +64,6 @@ END(remquof)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -64,6 +64,6 @@ ENTRY(remquol)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -15,6 +15,6 @@ END(rint)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -16,6 +16,6 @@ END(rintf)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -14,6 +14,6 @@ ENTRY(rintl)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -18,6 +18,6 @@ END(scalbn)
.globl CNAME(ldexp)
.set CNAME(ldexp),CNAME(scalbn)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -21,6 +21,6 @@ END(scalbnf)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -21,6 +21,6 @@ END(scalbnl)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -28,6 +28,6 @@ END(sin)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -30,6 +30,6 @@ END(tan)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -28,6 +28,6 @@ END(trunc)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -28,6 +28,6 @@ END(truncf)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -28,6 +28,6 @@ END(truncl)
/* Enable stack protection */
#if defined(__linux__) && defined(__ELF__)
#if defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View file

@ -47,7 +47,7 @@
#define _PDP_ENDIAN __ORDER_PDP_ENDIAN__
#define _BYTE_ORDER __BYTE_ORDER__
#elif defined(__linux)
#elif defined(__GLIBC__)
#include <features.h>
#include <endian.h>

View file

@ -5,7 +5,7 @@
#include <limits.h>
#include <stdint.h>
#ifdef __linux__
#ifdef __GLIBC__
/* Not sure what to do about __pure2 on linux */
#define __pure2
#endif