From nobody Tue Oct 11 20:33:34 2022 X-Original-To: dev-commits-ports-branches@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 4Mn6tk2vFjz4fMh8; Tue, 11 Oct 2022 20:33:34 +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 4Mn6tk2Q4tz3Rwy; Tue, 11 Oct 2022 20:33:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1665520414; 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=mx99hxRooxuu4Kk6Cei4IHh6ezPvoUai0WSckk4j5fg=; b=WYH/8ZLi1LIpIBtadNZ6pzKzYKssXHCk5xiU/rMPMbNk4GbFguLnpWEpnyhc5+WK1m/mjJ 57Jyc5SCvPKE6uOYjuJ2UDekjL17hebKQTncrbH470AEdoT+QiuMuC7Ntg70OXcmrDP/Uf WLpUoMUe65GBZlvGs0bUGA6jIOHeXy5KZf+8/LxQM9ReoLrc2UR/zUNuAbq8SHoTjcwwi0 sH9gt/HHWdvQYBLMUo1U8yk4FXQGEGaLgY7x9KjAVNol/KEjsMRo5QkBYzsgulzAnkhFdV 659PHe63t+BjtcgLVyJ9bYg+bT/LXDFngqfmNlJyCwVFg5LIrwq3X+v03fUB6A== 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 4Mn6tk1Smrz150Q; Tue, 11 Oct 2022 20:33:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 29BKXYau099037; Tue, 11 Oct 2022 20:33:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29BKXYFL099036; Tue, 11 Oct 2022 20:33:34 GMT (envelope-from git) Date: Tue, 11 Oct 2022 20:33:34 GMT Message-Id: <202210112033.29BKXYFL099036@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-branches@FreeBSD.org From: Gleb Popov Subject: git: 2397411e3efc - 2022Q4 - lang/ghc810: Add upstream patch fixing a rare linking problem. List-Id: Commits to the quarterly branches of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-branches@freebsd.org X-BeenThere: dev-commits-ports-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arrowd X-Git-Repository: ports X-Git-Refname: refs/heads/2022Q4 X-Git-Reftype: branch X-Git-Commit: 2397411e3efc0c10a099cfde52fdb6b0a2056378 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1665520414; 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=mx99hxRooxuu4Kk6Cei4IHh6ezPvoUai0WSckk4j5fg=; b=t8oweUpG3oFjnSl7A4IcQDjTsz7eRUJRWXXD49xeLrGFsmeMrK5hHIc+uyxJ63Dv2STvxU 1gxqKq0xgWeuIGdKqLsYftsgIfVAicIkeYk/G8RpHeUbc0XX30YlkkeLRMK7BbZ0n4zaS+ NJrapv9vsybgqUj2Jk7Com+E1+Aauj16bztZlSLskSo4JbvHlRfp8oyyD9j55Qz+Ell/kf Sq+v/8aG0xGLjGvifSCvXZnNgODzfE7cSmLZLoSf0wFTgIN5WKa7MJYeMOQNcOcg3KroVz BLQfrudZunwZvepNHo8k9+VPh7KG6m9kgundCKyq8VfDbPwubj/UXd56YAu+Tw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1665520414; a=rsa-sha256; cv=none; b=R9PN8WjZ9sHuF/rqQO7UzopCwV492/nFAUsaexs43+Vv088G2yeGkdZUAwRYgA2XpdVy8R Bg/glnFH+kePi8b8fcgsALnhGs/hfi60gF1vurGKp/I7SfXRLuC9Hhx3iqJkMS4uABV+YB 0nYBkKmFFjKAm4DZZ3+T9OlavhYboMz3v57Wswq4+ef/blPRbMfu4NgcdGKt5F9LM+svaB Z4E8aITp7sikEEHziPIYTOklDqPFaXHjvH0j1vurO+T30z/mZF307+kCYzIw0CayTChLds c+tz1sdaKoXoFETS1oEjyiEZx3nzHbNO/B7MDSR6f4oI0/CFAi74n8wcroTMQA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch 2022Q4 has been updated by arrowd: URL: https://cgit.FreeBSD.org/ports/commit/?id=2397411e3efc0c10a099cfde52fdb6b0a2056378 commit 2397411e3efc0c10a099cfde52fdb6b0a2056378 Author: Gleb Popov AuthorDate: 2022-10-11 19:51:42 +0000 Commit: Gleb Popov CommitDate: 2022-10-11 20:32:57 +0000 lang/ghc810: Add upstream patch fixing a rare linking problem. lang/ghc does not require patching. (cherry picked from commit 8fb4cfcd3ba24b8ef7d702860ce02caf114c3799) --- lang/ghc810/Makefile | 1 + lang/ghc810/files/patch-linker-iconv.diff | 89 +++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) diff --git a/lang/ghc810/Makefile b/lang/ghc810/Makefile index 0105166c8178..f6daff8f66f6 100644 --- a/lang/ghc810/Makefile +++ b/lang/ghc810/Makefile @@ -1,3 +1,4 @@ +PORTREVISION= 1 PKGNAMESUFFIX= 810 LIB_DEPENDS= ${GMP_LIB_DEPENDS} diff --git a/lang/ghc810/files/patch-linker-iconv.diff b/lang/ghc810/files/patch-linker-iconv.diff new file mode 100644 index 000000000000..a3f7a70fb528 --- /dev/null +++ b/lang/ghc810/files/patch-linker-iconv.diff @@ -0,0 +1,89 @@ +https://gitlab.haskell.org/ghc/ghc/-/commit/66d2e927842653fbc1cf2e6f997f443c78c2203b + +diff --git a/rts/Linker.c b/rts/Linker.c +index 1faff3b3716dd6de440071c89d0dafa471657962..12d5418d02a95893b14a619be10b5cd49a054f1a 100644 +--- rts/Linker.c ++++ rts/Linker.c +@@ -80,6 +80,33 @@ + #if defined(dragonfly_HOST_OS) + #include + #endif ++ ++/* ++ * Note [iconv and FreeBSD] ++ * ~~~~~~~~~~~~~~~~~~~~~~~~ ++ * ++ * On FreeBSD libc.so provides an implementation of the iconv_* family of ++ * functions. However, due to their implementation, these symbols cannot be ++ * resolved via dlsym(); rather, they can only be resolved using the ++ * explicitly-versioned dlvsym(). ++ * ++ * This is problematic for the RTS linker since we may be asked to load ++ * an object that depends upon iconv. To handle this we include a set of ++ * fallback cases for these functions, allowing us to resolve them to the ++ * symbols provided by the libc against which the RTS is linked. ++ * ++ * See #20354. ++ */ ++ ++#if defined(freebsd_HOST_OS) ++extern void iconvctl(); ++extern void iconv_open_into(); ++extern void iconv_open(); ++extern void iconv_close(); ++extern void iconv_canonicalize(); ++extern void iconv(); ++#endif ++ + /* + Note [runtime-linker-support] + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +@@ -637,6 +664,10 @@ internal_dlsym(const char *symbol) { + } + RELEASE_LOCK(&dl_mutex); + ++ IF_DEBUG(linker, debugBelch("internal_dlsym: looking for symbol '%s' in special cases\n", symbol)); ++# define SPECIAL_SYMBOL(sym) \ ++ if (strcmp(symbol, #sym) == 0) return (void*)&sym; ++ + # if defined(HAVE_SYS_STAT_H) && defined(linux_HOST_OS) && defined(__GLIBC__) + // HACK: GLIBC implements these functions with a great deal of trickery where + // they are either inlined at compile time to their corresponding +@@ -646,18 +677,28 @@ internal_dlsym(const char *symbol) { + // We borrow the approach that the LLVM JIT uses to resolve these + // symbols. See http://llvm.org/PR274 and #7072 for more info. + +- IF_DEBUG(linker, debugBelch("internal_dlsym: looking for symbol '%s' in GLIBC special cases\n", symbol)); ++ SPECIAL_SYMBOL(stat); ++ SPECIAL_SYMBOL(fstat); ++ SPECIAL_SYMBOL(lstat); ++ SPECIAL_SYMBOL(stat64); ++ SPECIAL_SYMBOL(fstat64); ++ SPECIAL_SYMBOL(lstat64); ++ SPECIAL_SYMBOL(atexit); ++ SPECIAL_SYMBOL(mknod); ++# endif + +- if (strcmp(symbol, "stat") == 0) return (void*)&stat; +- if (strcmp(symbol, "fstat") == 0) return (void*)&fstat; +- if (strcmp(symbol, "lstat") == 0) return (void*)&lstat; +- if (strcmp(symbol, "stat64") == 0) return (void*)&stat64; +- if (strcmp(symbol, "fstat64") == 0) return (void*)&fstat64; +- if (strcmp(symbol, "lstat64") == 0) return (void*)&lstat64; +- if (strcmp(symbol, "atexit") == 0) return (void*)&atexit; +- if (strcmp(symbol, "mknod") == 0) return (void*)&mknod; ++ // See Note [iconv and FreeBSD] ++# if defined(freebsd_HOST_OS) ++ SPECIAL_SYMBOL(iconvctl); ++ SPECIAL_SYMBOL(iconv_open_into); ++ SPECIAL_SYMBOL(iconv_open); ++ SPECIAL_SYMBOL(iconv_close); ++ SPECIAL_SYMBOL(iconv_canonicalize); ++ SPECIAL_SYMBOL(iconv); + # endif + ++#undef SPECIAL_SYMBOL ++ + // we failed to find the symbol + return NULL; + }