diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/expand/proc_macro.cpp | 2 | ||||
-rw-r--r-- | src/main.cpp | 4 | ||||
-rw-r--r-- | src/trans/target.cpp | 14 |
3 files changed, 19 insertions, 1 deletions
diff --git a/src/expand/proc_macro.cpp b/src/expand/proc_macro.cpp index 29bd6e8c..d34a91a5 100644 --- a/src/expand/proc_macro.cpp +++ b/src/expand/proc_macro.cpp @@ -24,7 +24,7 @@ # include <sys/wait.h> #endif -#ifdef __OpenBSD__ +#if defined(__OpenBSD__) || defined(__NetBSD__) extern char **environ; #endif diff --git a/src/main.cpp b/src/main.cpp index c63ce0d6..369c80de 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -52,6 +52,10 @@ # else # define DEFAULT_TARGET_NAME "i586-windows-gnu" # endif +#elif defined(__NetBSD__) +# if defined(__amd64__) +# define DEFAULT_TARGET_NAME "x86_64-unknown-netbsd" +# endif #elif defined(__OpenBSD__) # if defined(__amd64__) # define DEFAULT_TARGET_NAME "x86_64-unknown-openbsd" diff --git a/src/trans/target.cpp b/src/trans/target.cpp index 1f04666e..a91b1225 100644 --- a/src/trans/target.cpp +++ b/src/trans/target.cpp @@ -94,6 +94,13 @@ namespace ARCH_X86_64 }; } + else if(target_name == "x86_64-unknown-netbsd") + { + return TargetSpec { + "unix", "netbsd", "gnu", CodegenMode::Gnu11, "x86_64-unknown-netbsd", + ARCH_X86_64 + }; + } else if(target_name == "i686-unknown-openbsd") { return TargetSpec { @@ -147,6 +154,13 @@ void Target_SetCfg(const ::std::string& target_name) } Cfg_SetValue("target_env", g_target.m_env_name); + if( g_target.m_os_name == "netbsd" ) + { + Cfg_SetFlag("netbsd"); + Cfg_SetValue("target_vendor", "unknown"); + } + Cfg_SetValue("target_env", g_target.m_env_name); + if( g_target.m_os_name == "openbsd" ) { Cfg_SetFlag("openbsd"); |