diff --git a/lib/csu/mips/crt.h b/lib/csu/mips/crt.h index 509899b97b96..7da894280f53 100644 --- a/lib/csu/mips/crt.h +++ b/lib/csu/mips/crt.h @@ -27,5 +27,25 @@ #define _CRT_H_ #define HAVE_CTORS +#define CTORS_CONSTRUCTORS +#ifdef __mips_o32 +#define INIT_CALL_SEQ(func) \ + ".set noreorder \n" \ + "bal 1f \n" \ + "nop \n" \ + "1: \n" \ + ".cpload $ra \n" \ + ".set reorder \n" \ + "jal " __STRING(func) +#else +#define INIT_CALL_SEQ(func) \ + ".set noreorder \n" \ + "bal 1f \n" \ + "nop \n" \ + "1: \n" \ + ".set reorder \n" \ + ".cpsetup $ra, $v0, 1b \n" \ + "jal " __STRING(func) +#endif #endif diff --git a/lib/csu/sparc64/crt.h b/lib/csu/sparc64/crt.h index 509899b97b96..82984849630d 100644 --- a/lib/csu/sparc64/crt.h +++ b/lib/csu/sparc64/crt.h @@ -27,5 +27,7 @@ #define _CRT_H_ #define HAVE_CTORS +#define CTORS_CONSTRUCTORS +#define INIT_CALL_SEQ(func) "call " __STRING(func) "; nop" #endif diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index dc017618db4f..4e4ce4a535d1 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -193,6 +193,7 @@ __DEFAULT_YES_OPTIONS = \ ZONEINFO __DEFAULT_NO_OPTIONS = \ + BSD_CRTBEGIN \ BSD_GREP \ CLANG_EXTRAS \ DTRACE_TESTS \ @@ -385,13 +386,6 @@ BROKEN_OPTIONS+=HYPERV BROKEN_OPTIONS+=NVME .endif -.if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "i386" || \ - ${__T} == "powerpc64" -__DEFAULT_NO_OPTIONS+=BSD_CRTBEGIN -.else -BROKEN_OPTIONS+=BSD_CRTBEGIN -.endif - .include #