-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
OpenBSD: fix integration and broken specs #15118
Changes from all commits
b4d6fe9
a1f5bc6
562815e
d1438fc
848f61f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -500,6 +500,19 @@ module Crystal | |
else | ||
link_flags = @link_flags || "" | ||
link_flags += " -rdynamic" | ||
|
||
if program.has_flag?("freebsd") || program.has_flag?("openbsd") | ||
# pkgs are installed to usr/local/lib but it's not in LIBRARY_PATH by | ||
# default; we declare it to ease linking on these platforms: | ||
link_flags += " -L/usr/local/lib" | ||
end | ||
Comment on lines
+504
to
+508
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thought: I was wondering about the motivation for this. Seems like the default configuration is just sub-optimal. Apparently compilers in ports do add the folder, only the system compiler does not (https://wiki.freebsd.org/WarnerLosh/UsrLocal). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you build from ports, then a port can patch it in, yeah, but when you compile or cross compile your own crystal binary then it breaks and you must think to export LIBRARY_PATH. It ain't much, but that's nice. We did it before, but that got lost and I couldn't find why. |
||
|
||
if program.has_flag?("openbsd") | ||
# OpenBSD requires Indirect Branch Tracking by default, but we're not | ||
# compatible (yet), so we disable it for now: | ||
link_flags += " -Wl,-znobtcfi" | ||
end | ||
|
||
{DEFAULT_LINKER, %(#{DEFAULT_LINKER} "${@}" -o #{Process.quote_posix(output_filename)} #{link_flags} #{program.lib_flags(@cross_compile)}), object_names} | ||
end | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I didn't mean to push this fix in this PR but to make it it's own PR.
The problem here is that within my vagrant/libvirt VM resolving a hostname without an extension leads to 30 seconds (freeds, netbsd) to 2.5 minutes (openbsd) time to fail to resolve the name 😲
Using a domain with an extension, however, fails to resolve immediately 🤷