From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Omar Polo Newsgroups: gmane.emacs.bugs Subject: bug#45814: [PATCH] [native-comp] drop -ldl on OpenBSD Date: Tue, 12 Jan 2021 14:18:51 +0100 Message-ID: <87im828f9g.fsf@omarpolo.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23896"; mail-complaints-to="usenet@ciao.gmane.io" To: 45814@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 12 14:24:53 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kzJfI-00060R-VS for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 12 Jan 2021 14:24:53 +0100 Original-Received: from localhost ([::1]:50532 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kzJfH-0004Do-UJ for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 12 Jan 2021 08:24:51 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34666) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kzJad-00011R-IA for bug-gnu-emacs@gnu.org; Tue, 12 Jan 2021 08:20:05 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48035) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kzJac-0005cK-BL for bug-gnu-emacs@gnu.org; Tue, 12 Jan 2021 08:20:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kzJac-0000tm-6V for bug-gnu-emacs@gnu.org; Tue, 12 Jan 2021 08:20:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Omar Polo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 12 Jan 2021 13:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 45814 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16104575873427 (code B ref -1); Tue, 12 Jan 2021 13:20:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 12 Jan 2021 13:19:47 +0000 Original-Received: from localhost ([127.0.0.1]:59581 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kzJaN-0000tD-CU for submit@debbugs.gnu.org; Tue, 12 Jan 2021 08:19:47 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:36968) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kzJaJ-0000t4-U3 for submit@debbugs.gnu.org; Tue, 12 Jan 2021 08:19:46 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34610) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kzJaI-0000uA-3V for bug-gnu-emacs@gnu.org; Tue, 12 Jan 2021 08:19:43 -0500 Original-Received: from mail.omarpolo.com ([144.91.116.244]:65172) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kzJaE-0005Ud-1t for bug-gnu-emacs@gnu.org; Tue, 12 Jan 2021 08:19:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=omarpolo.com; s=20200327; t=1610457545; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=2iDomcvSDZYGFSvhu+beD4pEFgL8lLkO8+E0HD+IjfA=; b=nY6OYSjGuB5oMwpve219pyHnx0uaWLz4uyQA48iJ1aa3YVvyrsiOxZgHuqG2KLiJb9qkj2 zcsFH8NgGqldz1XP0Z/YjZLjKB9kyaqrTHqLzDC9zYbxA250gvrzmw60b9RD6PvtTD9Sdd kUSTWiwC4SaBWl/farQso18XMiR9WzM= Original-Received: from localhost (host-80-116-112-105.pool80116.interbusiness.it [80.116.112.105]) by mail.omarpolo.com (OpenSMTPD) with ESMTPSA id bc3bcc2e (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Tue, 12 Jan 2021 14:19:04 +0100 (CET) Original-Received: from venera (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 7d6991c6 for ; Tue, 12 Jan 2021 14:18:51 +0100 (CET) Received-SPF: pass client-ip=144.91.116.244; envelope-from=op@omarpolo.com; helo=mail.omarpolo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:197788 Archived-At: --=-=-= Content-Type: text/plain 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' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=diff 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 --=-=-= Content-Type: text/plain -- /Omar Polo --=-=-=--