GNU bug report logs - #48789
28.0.50; Emacs does not build with musl

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: akater <nuclearspace@HIDDEN>; dated Wed, 2 Jun 2021 11:38:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Severity set to 'normal' from 'important' Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 2 Jun 2021 11:37:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jun 02 07:37:12 2021
Received: from localhost ([127.0.0.1]:39061 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1loPBP-0006KA-KT
	for submit <at> debbugs.gnu.org; Wed, 02 Jun 2021 07:37:12 -0400
Received: from lists.gnu.org ([209.51.188.17]:47490)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <nuclearspace@HIDDEN>) id 1loPBN-0006Jz-P9
 for submit <at> debbugs.gnu.org; Wed, 02 Jun 2021 07:37:10 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:38938)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <nuclearspace@HIDDEN>)
 id 1loPBN-0000W4-Hv
 for bug-gnu-emacs@HIDDEN; Wed, 02 Jun 2021 07:37:09 -0400
Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]:34644)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <nuclearspace@HIDDEN>)
 id 1loPBK-0003DK-M0
 for bug-gnu-emacs@HIDDEN; Wed, 02 Jun 2021 07:37:09 -0400
Received: by mail-ej1-x633.google.com with SMTP id g8so3393852ejx.1
 for <bug-gnu-emacs@HIDDEN>; Wed, 02 Jun 2021 04:37:05 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:subject:date:message-id:mime-version;
 bh=9e27Txq+OtwbfYOzPPvxVK5Ognt3T+U3ILzMEg5ujXk=;
 b=PyaTekInHoAbNrL4MEFKqnTL/8E7/pmGAI7For6TdtPPUEuPX5pnestIU9ciTLlDEC
 dPjgM/9KvO467iP5b2VyA7sorO00UdrPNXFqdjTJCC++MaKx666JpyXQG0fZ0N6m5NQc
 mfAmk0IEyiwk3AOLGZuCWwdCLgT+Xtl9AQ/76Avkx30VDnQLE7QTa1ddz/ufuIUqxkFu
 LN3Hwm+Mm722HrzuWkclqdLdC2CbXDSfrcA92OMcUhlXXdfnl6WMgYJQdYjs+V4kD7RX
 Z/iteq2EQwooR+h8NQsKh7jr6Fcz7E7AxXS2H/zgqORS71LtvB4oZkwAI4iyHNpan+VD
 dgFQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:subject:date:message-id:mime-version;
 bh=9e27Txq+OtwbfYOzPPvxVK5Ognt3T+U3ILzMEg5ujXk=;
 b=Wk8cNOEHAIMe0Ouss0wrHaVsDpPNXSEhkiz1i6OnBHcfSFM2BqAzOzFiIbdX0K4ndp
 jjnaaTufh7n4Y247kP6UbEWToulVzGiuKpXgKgZKCia2UqG0Gu5qBJljcydFvPDuJFS1
 cF33I3TnUU6nySzKIVzxKs2YlAmSWbds+O8e6Z87PTAMWkxrXovZAXxBoXaIgGOnwCIr
 rkGPfYY4lXaRAo3ZYvSVhcJC4x3mjQoZBLEky0VPnRWTok10onKrk8TPGzL3xHCq+dfx
 PlKQsfxP0HXTJQEn6txICnFaqmj6z7Pmu+iOi8Ogrkpi0mziULgsDxOzOJGRAyVaJA28
 GecQ==
X-Gm-Message-State: AOAM531z7ZJQakLclcz3CviFs/BUCeLpy0Z9geB5zWEyZZxpC4y/MLfV
 C2N4sJsCHYErwcvNHicsp+KE6PyCY5w=
X-Google-Smtp-Source: ABdhPJxhyxFnnWe2iZCT0eJm60BtbpAVGzW13yhzdYkJh2DbbU2qKJgkD3ZIbGdQZus0lc4RVVjScw==
X-Received: by 2002:a17:906:2481:: with SMTP id
 e1mr34138459ejb.216.1622633824232; 
 Wed, 02 Jun 2021 04:37:04 -0700 (PDT)
Received: from localhost ([185.220.102.7])
 by smtp.googlemail.com with ESMTPSA id qh23sm2775783ejb.77.2021.06.02.04.37.03
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 02 Jun 2021 04:37:03 -0700 (PDT)
From: akater <nuclearspace@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 28.0.50; Emacs does not build with musl
Date: Wed, 02 Jun 2021 11:26:18 +0000
Message-ID: <87v96wo6cl.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=2a00:1450:4864:20::633;
 envelope-from=nuclearspace@HIDDEN; helo=mail-ej1-x633.google.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, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

(sectioned with Org markup if you want it)

* General information
The following is not a solution, just FYI:

Observing compiler (GCC 10.2.0) warnings and errors, on 2021-05-11 I
managed to build Emacs 28 with musl after reverting commits dealing with
two features,

an older one:

621bb79b7044dcc277386eb7338c0eb1e08c29c7 "New debugging command 'malloc-info'"

and a newer one --- everything related to lib-src/seccomp-filter.c

I provide the list of related commits but I likely made mistakes while
reverting so I don't attach the patch itself; the list is for
completenes.

I did not try to build Emacs 28 since, so commits newer than 2021-05-11
are not taken into account.  I will try if necessary.

Even though I did manage to build Emacs 28 with musl, my build is
extremely unreliable, regular crashes occur.  This might be due to my
lousy reverting, or due to an interference from native-comp feature, or
the neccesity to recompile third-party Elisp packages, or all at once.
Unfortunately, it so happened that I started using a musl system exactly
when native-comp is out.

Unable to use Emacs 28 here, I use Emacs 27.2 now which builds and works
totally fine with musl.

Below are: relevant commits and system configuration, for both 27.2 and 28.0.

* Commits for seccomp-filter
Here's the list of commits related to seccomp-filter that I (likely
incompetently) reverted, which allowed for Emacs 28 musl build:

Revert "Add a helper binary to create a basic Secure Computing filter."
This reverts commit 1060289f51ee1bf269bb45940892eb272d35af97

Revert "* lib-src/Makefile.in (clean): Tidy up seccomp-filter files."
This reverts commit aa354dd55b213b86ee8e3aa0365a6ad915838458.
Revert "Don't use symbolic links in the test resource directory."
This reverts commit a2842a11728336fc8110eedb5176ecfbe71bbc79.
Revert "Ensure that argument to 'verify' is a constant expression."
This reverts commit aaf6b6bf80805d18180e1c16350e9473716f5915.
Revert "Seccomp filter: deal with arch_prctl(ARCH_CET_STATUS, ...)."
This reverts commit 27af0a3dc8b6b45879904bbc5d54b0677f84a5ff.
Revert "Fix Seccomp filter on CentOS 8.3 (Bug#47828)."
This reverts commit 2822246b5d8154d0166e17ffd28a1d85b57d68aa.
Revert "Attempt to print some debugging information on Seccomp failures."
This reverts commit 568ce6826fa0aaa4d5dc95880cbdc0965dc07521.
Revert "* lib-src/seccomp-filter.c: Add missing headers."
This reverts commit 104c5e3d57705cd4bd291b61d7f165def602ab5c.
Revert "Generate Seccomp filters only if we have the necessary constants."
This reverts commit 17d20bb3cbb233ed0d94c3f1f9f3db768f526223.
Revert "* src/emacs.c (load_seccomp): Consistently check for nonzero result"
This reverts commit d37f0f3ac34f09830a881280131980f875d075d3.
Revert "Add a variant of the Seccomp filter file that allows 'execve'."
This reverts commit c8d542fd593f06b85d4b7b712378a4f84ec4d2b3.
Revert "* lib-src/seccomp-filter.c (main): Also allow O_NOFOLLOW."
This reverts commit cf0701eff0f3b06e0324be07f7810cbaf261f7f3.
Revert "Seccomp filter: allow reading the current time (Bug#47708)."
This reverts commit ea5ea09244b762008bba509d8c58bad5835fb949.
Revert "Use pkg-config to check for libseccomp."
This reverts commit 725fc96b706c57ef8ceca5e7d82b175d9a72e845.
Revert "Remove SCMP_FLTATR_CTL_LOG attribute from Seccomp filter."
This reverts commit d06c54db1b3504caed8673216a72b117d0692351.
Revert "Only attempt to generate seccomp filter files on x86-64 systems."
This reverts commit 9dc26d4a8add5b3f2a5fce7907af4f9673ae82c0.
Revert "* lib-src/seccomp-filter.c: Print trailing newline."
This reverts commit 553783628892a5363aacf58ce238969cb60a1c3a.
Revert "Also check for needed seccomp macros."
This reverts commit 25937821bc445235d984c4db8cb18dfbacd6a4ff.
Revert "* src/emacs.c (load_seccomp): Add a useful assertion."
This reverts commit 2db03e3e53af3ce5c87f64d163ab2be96aee2c0f.
Revert "* src/emacs.c (load_seccomp): Fix condition."
This reverts commit 496a46b32db9a3c32a846b8a3c872891303a1ec4.
Revert "Add a helper binary to create a basic Secure Computing filter."
This reverts commit 1060289f51ee1bf269bb45940892eb272d35af97.

* Emacs configuration
I'm using Gentoo, with musl profile ~default/linux/amd64/17.0/musl/hardened~.
** 27.2

Configured using:
 'configure --prefix=/usr --build=x86_64-gentoo-linux-musl
 --host=x86_64-gentoo-linux-musl --mandir=/usr/share/man
 --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc
 --localstatedir=/var/lib --disable-silent-rules
 --docdir=/usr/share/doc/emacs-27.2
 --htmldir=/usr/share/doc/emacs-27.2/html --libdir=/usr/lib
 --program-suffix=-emacs-27 --includedir=/usr/include/emacs-27
 --infodir=/usr/share/info/emacs-27 --localstatedir=/var
 --enable-locallisppath=/etc/emacs:/usr/share/emacs/site-lisp
 --without-compress-install --without-hesiod --without-pop
 --with-file-notification=no --with-pdumper --disable-acl --without-dbus
 --with-modules --without-gameuser --with-libgmp --without-gpm
 --with-json --without-kerberos --without-kerberos5 --without-lcms2
 --with-xml2 --without-mailutils --without-selinux --with-gnutls
 --without-libsystemd --with-threads --without-wide-int --with-zlib
 --with-sound=no --without-x --without-ns --with-dumping=pdumper
 'CFLAGS=-march=native -O2 -pipe' CPPFLAGS= 'LDFLAGS=-Wl,-O1
 -Wl,--as-needed''

Configured features:
GNUTLS LIBXML2 ZLIB MODULES THREADS JSON PDUMPER GMP

Important settings:
  value of $LANG: C.UTF8
  locale-coding-system: utf-8-unix

Memory information:
((conses 16 2211161 291586)
 (symbols 48 57073 2)
 (strings 32 259188 12930)
 (string-bytes 1 7862427)
 (vectors 16 109477)
 (vector-slots 8 1620006 88906)
 (floats 8 1626 870)
 (intervals 56 115451 4407)
 (buffers 1000 81))

** 28.0
The revision is ec574a72f7198d9793b466f33382fff397ac4ce1

Configured using:
 'configure --prefix=/usr --build=x86_64-gentoo-linux-musl
 --host=x86_64-gentoo-linux-musl --mandir=/usr/share/man
 --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc
 --localstatedir=/var/lib --disable-silent-rules
 --docdir=/usr/share/doc/emacs-28.0.9999
 --htmldir=/usr/share/doc/emacs-28.0.9999/html --libdir=/usr/lib
 --program-suffix=-emacs-28-vcs --includedir=/usr/include/emacs-28-vcs
 --infodir=/usr/share/info/emacs-28-vcs --localstatedir=/var
 --enable-locallisppath=/etc/emacs:/usr/share/emacs/site-lisp
 --without-compress-install --without-hesiod --without-pop
 --with-file-notification=no --with-pdumper --disable-acl
 --disable-link-time-optimization --without-dbus --with-modules
 --without-gameuser --with-libgmp --without-gpm --with-json
 --without-kerberos --without-kerberos5 --without-lcms2 --with-xml2
 --without-mailutils --without-selinux --with-gnutls
 --without-libsystemd --with-threads --without-native-compilation
 --without-wide-int --with-zlib --with-sound=no --without-imagemagick
 --without-x --without-ns --with-dumping=pdumper 'CFLAGS=-march=native
 -O2 -pipe' CPPFLAGS= 'LDFLAGS=-Wl,-O1 -Wl,--as-needed''

Configured features:
GMP GNUTLS JSON LIBXML2 MODULES PDUMPER SECCOMP THREADS ZLIB

Important settings:
  value of $LANG: C.UTF8
  locale-coding-system: utf-8-unix

Memory information:
((conses 16 409599 310905)
 (symbols 48 41434 3)
 (strings 32 163330 24933)
 (string-bytes 1 5104681)
 (vectors 16 68170)
 (vector-slots 8 715297 489605)
 (floats 8 393 1947)
 (intervals 56 1099 72)
 (buffers 992 13))




Acknowledgement sent to akater <nuclearspace@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#48789; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 3 Jun 2021 08:15:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.