From nobody Sun May 26 17:40:20 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VnQz83z8Vz5LPwB; Sun, 26 May 2024 17:40:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VnQz81hsVz53vC; Sun, 26 May 2024 17:40:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716745220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rN9zgSxZG4WHlL1gkvfEAjeAWe0xYmjRuSGBVLIWyLs=; b=M5j+52Od5219cKWWJJFRhoPBkFpd28vSOJykkZznoA8kijbPTlYrGsX7DZ9xi1EPCAQhYd w2a57AKpNkckW7shdIAsLgZh0BMAktPuVBSzxC2cF4lby3iOZN3syCTIBuHTgs9q5pPe/q Azmosv0h3AFiNkYENGd5QtQT8Yyw0tydsZOc5S4Rzj58urnKSJCqa2W7Wp4Fni+yfhVcTg u7UGS4uQGwT/M7HR4wA0aE3BC3pLu1YIQBMZ1CtDsUmMDF0WnoOCLpU8rv70AT2bO+hUSg IgSfpFLSstpVpvuPihNB21R6RKMnEair3fAeuphVI5YcoakYe/V+4vQxsSH1NQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716745220; a=rsa-sha256; cv=none; b=aZPiTEYDZvu2gtq+qrACIWm1Hpabqw6KAnd+L6L6HjnfSOMTY0KYXQeM+KXH3TxJ1aKPsG gLV/lvJHF4e9NwmvNG6ALx9/EgEKwXxb9nprmq96YAi++RDhc2JQn/lo7gU+zOzmTBiBnX kcIO74Oturi2tUY20/K0nQRUvk1iIdKmKqsWvmcswXU9NwCxiyxGtMbgjwiqCdUHi+OJjX qkc6CTScGLHEU3Ha+DAkSprY35dRXKTdRAEY3yHbZlURgVtXO/DT2rUUFK8iB2G9jBgaG4 9MPigVdjEs179sL+VI7D2M34Nf6zzbKD4FmE8R0LOJHwyCkVxYMHcofVjrZRPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716745220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rN9zgSxZG4WHlL1gkvfEAjeAWe0xYmjRuSGBVLIWyLs=; b=wgDwsTzzlkCY9TyE9v8StITEgM+Ra/gmnPAShmh85pHBg6r1VGifl1kVNVD3ApQdBwMOMX bfclDiAH+y8piESBGGvOkst3rrKCwrMLiQQcrXMn6mdrI50NH/Ltapbv/aPP2aJLYD8rww /s+TFOgWBhJi8OsmDXi/ikK+E4puuAiUKm5Th6HC2PmxQU0MkbiwN5ejTKkaTRBN8ZYu6H iJTppg2MQtHIXMQO1RvsBe6JrrA5pj9BlLMSiZnXMW9O2sBN3cFnAd7KaDnshqE9erjITe ms95xHLL3R66rODWQrhTc7Qouv8LNQMw66YD0my1iBOSyQ9jcR5Jkz4NQnav2Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VnQz81GkGz18h2; Sun, 26 May 2024 17:40:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44QHeKxi085313; Sun, 26 May 2024 17:40:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44QHeKV8085310; Sun, 26 May 2024 17:40:20 GMT (envelope-from git) Date: Sun, 26 May 2024 17:40:20 GMT Message-Id: <202405261740.44QHeKV8085310@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 364c014d9ba0 - main - cross-tools: fts has different types for cmp routine List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 364c014d9ba052758f32d2e3e1b0c297c64ac730 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=364c014d9ba052758f32d2e3e1b0c297c64ac730 commit 364c014d9ba052758f32d2e3e1b0c297c64ac730 Author: Warner Losh AuthorDate: 2024-05-26 17:38:30 +0000 Commit: Warner Losh CommitDate: 2024-05-26 17:38:30 +0000 cross-tools: fts has different types for cmp routine fts has different types for its compare rotuine. Other systems, not 4.4BSD based, have a non-const version. Before we tested against __GLIBC__, but now we test against __linux__ because that's Linux's API and musl doesn't define __GLIBC__. In addition, link against libftl on this platform since musl doesn't include ftl routines in libc, but rather in libftl. Co-authored-by: Val Packett Sponsored by: Netflix Pull Request: https://github.com/freebsd/freebsd-src/pull/1066 Reviewed by: val_packett.cool Differential Revision: https://reviews.freebsd.org/D45349 --- contrib/mandoc/config.h | 2 +- lib/libpmc/pmu-events/jevents.c | 2 +- tools/build/mk/Makefile.boot | 4 ++++ usr.sbin/kldxref/kldxref.c | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/contrib/mandoc/config.h b/contrib/mandoc/config.h index 91957717b3fc..ea6d70042670 100644 --- a/contrib/mandoc/config.h +++ b/contrib/mandoc/config.h @@ -13,7 +13,7 @@ #define HAVE_ENDIAN 0 #define HAVE_ERR 1 #define HAVE_FTS 1 -#if defined(__GLIBC__) || defined(__APPLE__) +#if defined(__linux__) || defined(__APPLE__) #define HAVE_FTS_COMPARE_CONST 0 #else #define HAVE_FTS_COMPARE_CONST 1 diff --git a/lib/libpmc/pmu-events/jevents.c b/lib/libpmc/pmu-events/jevents.c index 7059b31da2ba..628ed26c6f9d 100644 --- a/lib/libpmc/pmu-events/jevents.c +++ b/lib/libpmc/pmu-events/jevents.c @@ -1355,7 +1355,7 @@ err_out: #include static int -#if defined(__GLIBC__) || defined(__APPLE__) +#if defined(__linux__) || defined(__APPLE__) fts_compare(const FTSENT **a, const FTSENT **b) #else fts_compare(const FTSENT * const *a, const FTSENT * const *b) diff --git a/tools/build/mk/Makefile.boot b/tools/build/mk/Makefile.boot index 9f63a7499592..b8a5c7780948 100644 --- a/tools/build/mk/Makefile.boot +++ b/tools/build/mk/Makefile.boot @@ -50,6 +50,10 @@ CFLAGS+= -I${SRCTOP}/tools/build/cross-build/include/linux CFLAGS+= -D_GNU_SOURCE=1 # Needed for sem_init, etc. on Linux (used by usr.bin/sort) LDADD+= -pthread +.if exists(/usr/lib/libfts.so) || exists(/usr/lib/libfts.a) || exists(/lib/libfts.so) || exists(/lib/libfts.a) +# Needed for fts_open, etc. on musl (used by usr.bin/grep) +LDADD+= -lfts +.endif .elif ${.MAKE.OS} == "Darwin" CFLAGS+= -D_DARWIN_C_SOURCE=1 diff --git a/usr.sbin/kldxref/kldxref.c b/usr.sbin/kldxref/kldxref.c index c88769ce1824..122551940ac7 100644 --- a/usr.sbin/kldxref/kldxref.c +++ b/usr.sbin/kldxref/kldxref.c @@ -745,7 +745,7 @@ usage(void) } static int -#if defined(__GLIBC__) || defined(__APPLE__) +#if defined(__linux__) || defined(__APPLE__) compare(const FTSENT **a, const FTSENT **b) #else compare(const FTSENT *const *a, const FTSENT *const *b)