From: Omar Polo <op@omarpolo.com>
To: 45814@debbugs.gnu.org
Subject: bug#45814: [PATCH] [native-comp] drop -ldl on OpenBSD
Date: Tue, 12 Jan 2021 14:18:51 +0100 [thread overview]
Message-ID: <87im828f9g.fsf@omarpolo.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1683 bytes --]
Tags: patch
TL;DR: on openbsd the various dl* functions are in libc. The attached
patch drops the -ldl here.
Longer version:
I wanted to try the native-comp. On OpenBSD gcc 10 isn't available, and
gcc 8 doesn't bundle libgccjit. I hacked the port of of gcc 8 to
provide also the libgccjit, but even if the "smoke test" worked,
building emacs with gcc8 and libgccjit failed. (this was a couple of
months ago at least). Today I gave it another shot and built gcc 10
from sources somewhere in my $HOME, and then managed to get emacs up and
running :) -- honestly, given the amount of hacks to get gcc10 working
in $HOME I am surprised nothing has exploded yet.
I still get a bunch of warnings (atm *Warnings* is 301 lines long), but
they are related to how I installed libgccjit and gcc10, not emacs
itself.
Anyway, none of the above is really about the patch. The only real
modification on the emacs side was to drop -ldl (and something related
get getopt_long, but I need to investigate that a bit more).
Thanks
In GNU Emacs 28.0.50 (build 1, x86_64-unknown-openbsd6.8, X toolkit, cairo version 1.16.0, Xaw3d scroll bars)
of 2021-01-12 built on venera
Repository revision: ce0c9c349363b5dbea56f7e32c838a93c729263d
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12010000
System Description: OpenBSD venera 6.8 GENERIC.MP#223 amd64
Configured using:
'configure CC=mygcc 'CFLAGS=-I /home/op/opt/gcc10/include/
-I/usr/include -I/usr/local/include' 'LDFLAGS=-L/usr/lib
-L/usr/local/lib -L/home/op/opt/gcc10/lib -lmyuglyhack'
--prefix=/home/op/opt/native-emacs --with-x-toolkit=lucid
--with-nativecomp --without-makeinfo'
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: diff --]
[-- Type: text/patch, Size: 818 bytes --]
diff --git a/configure.ac b/configure.ac
index e3a96a2b69..76ec3d1946 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3820,10 +3820,15 @@ if test "${with_nativecomp}" != "no"; then
AC_RUN_IFELSE([libgccjit_smoke_test], [], [libgccjit_broken])
LIBS=$emacs_save_LIBS
HAVE_NATIVE_COMP=yes
- # mingw32 loads the library dynamically.
- if test "${opsys}" != "mingw32"; then
- LIBGCCJIT_LIB="-lgccjit -ldl"
- fi
+ case "${opsys}" in
+ # mingw32 loads the library dynamically.
+ mingw32) ;;
+ # OpenBSD doesn't have libdl, all the functions are in libc
+ openbsd)
+ LIBGCCJIT_LIB="-lgccjit" ;;
+ *)
+ LIBGCCJIT_LIB="-lgccjit -ldl" ;;
+ esac
NEED_DYNLIB=yes
AC_DEFINE(HAVE_NATIVE_COMP, 1, [Define to 1 if native compiler is available.])
fi
[-- Attachment #3: Type: text/plain, Size: 16 bytes --]
--
/Omar Polo
next reply other threads:[~2021-01-12 13:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-12 13:18 Omar Polo [this message]
2021-01-12 20:04 ` bug#45814: [PATCH] [native-comp] drop -ldl on OpenBSD Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-01-12 20:12 ` Omar Polo
2021-01-12 20:16 ` Lars Ingebrigtsen
2021-01-12 20:35 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87im828f9g.fsf@omarpolo.com \
--to=op@omarpolo.com \
--cc=45814@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).