diff --git a/src/cmd/builtin/Mamfile b/src/cmd/builtin/Mamfile index 873ad99d04fc..20f5e7a2a093 100644 --- a/src/cmd/builtin/Mamfile +++ b/src/cmd/builtin/Mamfile @@ -37,7 +37,7 @@ make install meta FEATURE/pty features/%>FEATURE/% features/pty pty make features/pty done features/pty - exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS} -lm" ref ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libast} ${mam_libcmd} : run features/pty + exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libast} ${mam_libcmd} : run features/pty done FEATURE/pty generated make ${PACKAGE_ast_INCLUDE}/ast_time.h implicit done ${PACKAGE_ast_INCLUDE}/ast_time.h diff --git a/src/cmd/builtin/features/pty b/src/cmd/builtin/features/pty index 612609b36f21..ab4a041ec530 100755 --- a/src/cmd/builtin/features/pty +++ b/src/cmd/builtin/features/pty @@ -13,7 +13,7 @@ lib openpty,_getpty,ptsname -lutil lib grantpt,unlockpt,posix_openpt stdlib.h lib cfmakeraw termios.h -tst - output{ +tst - -lm output{ #include #if _lib_ptsname #include diff --git a/src/lib/libast/comp/atexit.c b/src/lib/libast/comp/atexit.c index d0df2d524b3f..c29ce5a73551 100644 --- a/src/lib/libast/comp/atexit.c +++ b/src/lib/libast/comp/atexit.c @@ -34,11 +34,7 @@ NoN(atexit) #else -#if _lib_onexit || _lib_on_exit - -#if !_lib_onexit -#define onexit on_exit -#endif +#if _lib_onexit extern int onexit(void(*)(void)); diff --git a/src/lib/libast/features/lib b/src/lib/libast/features/lib index 522c4c3002a1..39410ad93937 100644 --- a/src/lib/libast/features/lib +++ b/src/lib/libast/features/lib @@ -29,7 +29,7 @@ lib getopt,getsubopt,getopt_long,getopt_long_only lib glob,index,iswblank,iswctype,killpg,link,localeconv,madvise lib mbtowc,mbrtowc,memalign,memchr,memcpy,memdup,memmove,memset lib mkdir,mkfifo,mktemp,mktime -lib mount,on_exit,onexit,opendir,pathconf +lib mount,onexit,opendir,pathconf lib readlink,remove,rename,rewinddir,rindex,rmdir,setlocale lib setpgid,setpgrp,setpgrp2,setreuid,setsid,setuid,sigaction lib sigprocmask,sigsetmask,sigunblock,sigvec,socketpair diff --git a/src/lib/libast/include/ast.h b/src/lib/libast/include/ast.h index 00aa5fd805aa..3ce8eccf0b67 100644 --- a/src/lib/libast/include/ast.h +++ b/src/lib/libast/include/ast.h @@ -78,6 +78,19 @@ struct _sfio_s; #endif #endif +/* + * tcc on FreeBSD: Avoid using nonexistent math + * builtins by pretending to be an ancient gcc. + */ +#if __TINYC__ && __GNUC__ >= 3 && __FreeBSD__ +#undef __GNUC__ +#undef __GNUC_MINOR__ +#undef __GNUC_PATCHLEVEL__ +#define __GNUC__ 2 +#define __GNUC_MINOR__ 95 +#define __GNUC_PATCHLEVEL__ 3 +#endif + /* * exit() support -- this matches shell exit codes */ diff --git a/src/lib/libast/vmalloc/malloc.c b/src/lib/libast/vmalloc/malloc.c index 8639740dc986..5b3708f21186 100644 --- a/src/lib/libast/vmalloc/malloc.c +++ b/src/lib/libast/vmalloc/malloc.c @@ -1040,12 +1040,8 @@ extern Void_t* F1(_ast_valloc, size_t,n) { return valloc(n); } #if !_UWIN -#if !_malloc_hook - #include -#endif - typedef struct mallinfo Mallinfo_t; typedef struct mstats Mstats_t; diff --git a/src/lib/libast/vmalloc/vmexit.c b/src/lib/libast/vmalloc/vmexit.c index c027fd56ca7b..7752e09676b2 100644 --- a/src/lib/libast/vmalloc/vmexit.c +++ b/src/lib/libast/vmalloc/vmexit.c @@ -93,7 +93,7 @@ int type; return type; } -#endif /* _lib_onexit || _lib_on_exit */ +#endif /* _lib_onexit */ #endif /*!PACKAGE_ast*/ diff --git a/src/lib/libdll/Mamfile b/src/lib/libdll/Mamfile index 0ef420e967b9..29d9ddb5e82f 100644 --- a/src/lib/libdll/Mamfile +++ b/src/lib/libdll/Mamfile @@ -154,7 +154,7 @@ make install done features/dll bind -ldl dontcare bind -last - exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS} -lm" ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdl} ${mam_libast} : run features/dll + exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdl} ${mam_libast} : run features/dll done FEATURE/dll generated exec - cmp 2>/dev/null -s FEATURE/dll dlldefs.h || { rm -f dlldefs.h; silent test -d . || mkdir .; cp FEATURE/dll dlldefs.h; } done dlldefs.h generated diff --git a/src/lib/libdll/features/dll b/src/lib/libdll/features/dll index e5d5790f2bd4..86163b46e016 100644 --- a/src/lib/libdll/features/dll +++ b/src/lib/libdll/features/dll @@ -74,7 +74,7 @@ tst run{ esac echo "#define _DLL_NEXT_PATH \"$lib\"" }end -tst - output{ +tst - -lm output{ #include #if defined(__MVS__) && !defined(__SUSV3) #define __SUSV3 1