Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NetBSD support #1247

Merged
merged 1 commit into from Jan 19, 2016
Merged

NetBSD support #1247

merged 1 commit into from Jan 19, 2016

Conversation

sibnick
Copy link
Contributor

@sibnick sibnick commented Jan 8, 2016

No description provided.

@@ -39,7 +39,7 @@
*/

#if !IN_LLVM
//#if TARGET_LINUX || TARGET_OSX || TARGET_FREEBSD || TARGET_OPENBSD || TARGET_SOLARIS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why add to a commented out list? What is this even for?

Update: never mind, David explained it below.

@joakim-noah
Copy link
Contributor

Would be better if all the dmd2/ modifications were submitted upstream.

@@ -385,6 +385,11 @@ int tryMain(size_t argc, const char *argv[])
VersionCondition::addPredefinedGlobalIdent("OpenBSD");
VersionCondition::addPredefinedGlobalIdent("ELFv1");
global.params.isFreeBSD = true;
#elif TARGET_NETBSD
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A large part of the code in this file is DMD-only; we don't use it (see the IN_LLVM conditionals). Please either drop those changes or submit them to upstream DMD (although the file has been converted to D there), as it just increases the size of the upstream diff we have to manage for no benefit.

@JohanEngelen
Copy link
Member

I have restarted the Travis build for LLVM 3.5. I think it was some spurious error.

@redstar
Copy link
Member

redstar commented Jan 9, 2016

See also #1248.

@sibnick
Copy link
Contributor Author

sibnick commented Jan 13, 2016

Thanks everybody. I will fix issues on this week (I hope).

@@ -977,6 +977,7 @@ int main(int argc, char **argv) {
global.params.isWindows = triple.isOSWindows();
global.params.isFreeBSD = triple.getOS() == llvm::Triple::FreeBSD;
global.params.isOpenBSD = triple.getOS() == llvm::Triple::OpenBSD;
global.params.isNetBSD = triple.getOS() == llvm::Triple::NetBSD;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need for this with #1249 . Just use global.params.targetTriple if needed.

@sibnick sibnick force-pushed the netbsd branch 3 times, most recently from 0c6cf14 to cda773e Compare January 18, 2016 17:38
@sibnick
Copy link
Contributor Author

sibnick commented Jan 18, 2016

Please take look to my fixes

@dnadlinger
Copy link
Member

Hi Nikolay, could you please remove the unused isNetBSD declaration? Also, you probably want to define the NetBSD version identifier when compiling for NetBSD, see registerPredefinedTargetVersions() in driver/main.cpp.

@sibnick
Copy link
Contributor Author

sibnick commented Jan 18, 2016

klickverbot: ...to define the NetBSD version identifier when compiling for NetBSD, see registerPredefinedTargetVersions() in driver/main.cpp.

https://github.com/ldc-developers/ldc/blob/master/driver/main.cpp already contains NetBSD section on line 770

@sibnick
Copy link
Contributor Author

sibnick commented Jan 18, 2016

I remove the unused isNetBSD declaration

@@ -83,6 +83,7 @@ else()
endif()
file(GLOB_RECURSE CORE_D_UNIX ${RUNTIME_DIR}/src/core/sys/posix/*.d)
file(GLOB_RECURSE CORE_D_FREEBSD ${RUNTIME_DIR}/src/core/sys/freebsd/*.d)
file(GLOB_RECURSE CORE_D_NETBSD ${RUNTIME_DIR}/src/core/sys/netbsd/*.d)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you planning on adding any NetBSD-specific declarations to this druntime directory? If not, better to leave this out until you need it.

Are you able to get ldc passing the druntime/phobos tests with only this patch to ldc? If not, you might want to get that working first, then finish this ldc PR after you're sure it's working.

@sibnick
Copy link
Contributor Author

sibnick commented Jan 19, 2016

Are you planning on adding any NetBSD-specific declarations to this druntime directory? ... Are you able to get ldc passing the druntime/phobos tests with only this patch to ldc?

Yes. core/sys/netbsd is necessary for passing unit tests.
You can look to current version: https://github.com/nrTQgc/druntime/tree/netbsd/src/core/sys/netbsd

@joakim-noah
Copy link
Contributor

OK, looks like you just copied the contents of core.sys.freebsd over.

What is the status of the druntime/phobos tests for you on NetBSD, everything passes?

dnadlinger added a commit that referenced this pull request Jan 19, 2016
NetBSD support (compiler parts)
@dnadlinger dnadlinger merged commit 880483b into ldc-developers:master Jan 19, 2016
@dnadlinger
Copy link
Member

Thanks!

Getting all of the test suite to pass will of course be the next challenge. ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants