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

build: ease DragonFlyBSD build #29284

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/debug_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@
#endif // __POSIX__

#if defined(__linux__) || defined(__sun) || \
defined(__FreeBSD__) || defined(__OpenBSD__)
defined(__FreeBSD__) || defined(__OpenBSD__) || \
defined(__DragonFly__)
#include <link.h>
#endif // (__linux__) || defined(__sun) ||
// (__FreeBSD__) || defined(__OpenBSD__)
// (__DragonFly__)

#ifdef __APPLE__
#include <mach-o/dyld.h> // _dyld_get_image_name()
Expand Down Expand Up @@ -333,7 +335,8 @@ void PrintLibuvHandleInformation(uv_loop_t* loop, FILE* stream) {

std::vector<std::string> NativeSymbolDebuggingContext::GetLoadedLibraries() {
std::vector<std::string> list;
#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__)
#if defined(__linux__) || defined(__FreeBSD__) || \
defined(__OpenBSD__) || defined(__DragonFly__)
dl_iterate_phdr(
[](struct dl_phdr_info* info, size_t size, void* data) {
auto list = static_cast<std::vector<std::string>*>(data);
Expand Down
4 changes: 4 additions & 0 deletions src/large_pages/node_large_page.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
#include "util.h"
#include "uv.h"

#if defined(__DragonFly__)
#error "Large pages is not supported by this platform"
#endif
Copy link
Member

Choose a reason for hiding this comment

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

It would be nicer to error out in configure.py rather than defer until build time. It should preferably also be its own separate commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That comes more from the fact dragonflybsd "is" FreeBSD from configure standpoint.


#include <fcntl.h> // _O_RDWR
#include <sys/types.h>
#include <sys/mman.h>
Expand Down
2 changes: 2 additions & 0 deletions tools/gyp/pylib/gyp/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,8 @@ def GetFlavor(params):
return 'solaris'
if sys.platform.startswith('freebsd'):
return 'freebsd'
if sys.platform.startswith('dragonfly'):
return 'freebsd'
if sys.platform.startswith('openbsd'):
return 'openbsd'
if sys.platform.startswith('netbsd'):
Expand Down
4 changes: 4 additions & 0 deletions tools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ def GuessOS():
return 'solaris'
elif id == 'NetBSD':
return 'netbsd'
elif id == 'DragonFly':
# Doing so on purpose as they are pretty close
# minus few features
return 'freebsd'
elif id == 'AIX':
return 'aix'
else:
Expand Down