From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Jeffrey Walton Newsgroups: gmane.emacs.devel Subject: make check fails to link due to missing -lpthread? Date: Fri, 3 May 2019 12:07:30 -0400 Message-ID: Reply-To: noloader@gmail.com Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="2936"; mail-complaints-to="usenet@blaine.gmane.org" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 03 23:16:37 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hMfXY-0017On-RA for ged-emacs-devel@m.gmane.org; Fri, 03 May 2019 23:16:20 +0200 Original-Received: from localhost ([127.0.0.1]:43370 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMazt-0006qG-D8 for ged-emacs-devel@m.gmane.org; Fri, 03 May 2019 12:25:17 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:41889) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMaj4-00061E-8K for emacs-devel@gnu.org; Fri, 03 May 2019 12:07:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMaj3-0002g2-7d for emacs-devel@gnu.org; Fri, 03 May 2019 12:07:54 -0400 Original-Received: from mail-io1-xd2f.google.com ([2607:f8b0:4864:20::d2f]:44137) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hMaj2-0002fc-Uy for emacs-devel@gnu.org; Fri, 03 May 2019 12:07:53 -0400 Original-Received: by mail-io1-xd2f.google.com with SMTP id v9so1735737ion.11 for ; Fri, 03 May 2019 09:07:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:reply-to:from:date:message-id:subject:to; bh=ePtRtpxbiGAfA5fViM/pTEMdDkAQCm6aJCOKnsTFE+A=; b=RLSvGgN5JIe6YjUPOrK073oFkUbTDS9vp3Prp3fXqEQkzWRk9OngRlQ6YWH6JrQWFi zJE1OUh29wZzyk6aEX/zA/LRjgk2H1V4Y8lrcknF2AmwtsJF8te1bZDKyWAjVBOLq6Sv aB5sTvufBkTTy/oYWH3f0+orc2CZp8IUc65hwLxgS8GG9Xyj2cf5ceJ/cioSRgl2Lb2U IQsYZCSo7M/29WN2bC+KBgUKbwff8ByMfr5Iq/a6GbBwL2sOTj37g/9FgqcQ6ZdtKlwH BYYzoMAbvS4q9LcKjuhy/VoSv4Sd40myChcku3nCTc0O8BOM1XZbFkR4Q/jc0wCNfEZ5 lyJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:from:date:message-id :subject:to; bh=ePtRtpxbiGAfA5fViM/pTEMdDkAQCm6aJCOKnsTFE+A=; b=MsS0JHNVEjbOLOxaLqa1eRmv7qmr5qPY0GAp2fiibbQqYtlKsv/Y63PSPpM3wKkifm fiQbgjtpz+SRF8r5AW5JkW685+YhEAHbv0L+wVLmexb6acmYTZDukc3lzV8lHQMqr6Hy QJeZ2wOkjsdRSMc0p8DaMbYpuYaFxY+FHezmltybVtDo4/NfSoHF4KPTTSmY0LYmXfz3 V0MIbo/9uTZf7xHfkSFOMQ9zDIzFJGnH9r8oMLvwpZGI5myZ7SNFAWVNAd7DmmkibVca 3AFFUB3llAK5LL3YUOCMWpL93jENA/XmvVW1HlIEo0apXNqKFOZe2qnBI3wT7qFBAsPB hXZw== X-Gm-Message-State: APjAAAVepBCWsPQJIDAwWXwGJw5dUWrSsO5pa7IdoRaFK+u9zU3k5Dyn WdlyocJbVYEhIHAcyiOmjD9F58foMspm/WAgb400ONJe X-Google-Smtp-Source: APXvYqwlPPJdYNsuZF0xkywItrTUVURld5uyXxsvOflQwGT5rnFRqBl/I9A4VjcGg1JhUQaqLmeWsAaA19lITnsmNAM= X-Received: by 2002:a6b:7f0a:: with SMTP id l10mr7345573ioq.10.1556899671913; Fri, 03 May 2019 09:07:51 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::d2f X-Mailman-Approved-At: Fri, 03 May 2019 12:23:59 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:236121 Archived-At: Hi Everyone, I have some build scripts that use consistent flags and options for all packages. It is helpful when acceptance testing a package, like adding -fsanitize=undefined during testing. The non-testing flags are: BITNESS: 64-bits PREFIX: /usr/local LIBDIR: /usr/local/lib64 PKG_CONFIG_PATH: /usr/local/lib64/pkgconfig CPPFLAGS: -I/usr/local/include -DNDEBUG CFLAGS: -g2 -O2 -march=native -fPIC CXXFLAGS: -g2 -O2 -march=native -fPIC LDFLAGS: -L/usr/local/lib64 -Wl,-R,/usr/local/lib64 -Wl,--enable-new-dtags LDLIBS: -ldl -lpthread In the case of Emacs 'make check' fails to link on Fedora: gcc -Demacs -I. -I. -I../lib -I../lib -MMD -MF deps/.d -MP -g2 -O2 -march=native -fPIC -Wl,-znocombreloc -no-pie -L/usr/local/lib64 -Wl,-R,/usr/local/lib64 -Wl,--enable-new-dtags \ -o temacs dispnew.o frame.o scroll.o xdisp.o menu.o window.o charset.o coding.o category.o ccl.o character.o chartab.o bidi.o cm.o term.o terminal.o xfaces.o emacs.o keyboard.o macros.o keymap.o sysdep.o buffer.o filelock.o insdel.o marker.o minibuf.o fileio.o dired.o cmds.o casetab.o casefiddle.o indent.o search.o regex.o undo.o alloc.o data.o doc.o editfns.o callint.o eval.o floatfns.o fns.o font.o print.o lread.o syntax.o unexelf.o bytecode.o process.o gnutls.o callproc.o region-cache.o sound.o atimer.o doprnt.o intervals.o textprop.o composite.o xml.o lcms.o inotify.o profiler.o decompress.o thread.o systhread.o sheap.o terminfo.o lastfile.o gmalloc.o ../lib/libegnu.a -lrt -ltinfo -lanl -lm -lz /bin/ld: emacs.o: undefined reference to symbol 'pthread_sigmask@@GLIBC_2.2.5' /bin/ld: //usr/lib64/libpthread.so.0: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status On Red Hat and Fedora I believe this is because of `-lrt`. I patch the makefiles so '-lrt' becomes '-;rt -lpthread'. I do so (1) after unpacking the tarball; and (2) after configure. It usually sidesteps this error. for file in $(find "$PWD" -iname 'Makefile') do echo "patching $file" sed -e 's|-lrt|-lrt -lpthread|g' "$file" > "$file.fixed" mv "$file.fixed" "$file" touch -t 197001010000 "$file" done In the case of Emacs it is not working. I suspect Emacs is creating makefiles after configure so they can't be patched. My question is, how do I have Emacs honor the use of -lpthread? Or how do I patch Emacs so my changes are used? (The preferred solution does not require autoreconf. Some systems I build on are so old Autools creates too problems when trying to run autoreconf. Autotools is effectively a DoS in these cases. That's why touch is used to set the filetime in the past on some files). Jeff