From bd62e7aaff21a13a0fb8e6f987e68a4a1e7deb5c Mon Sep 17 00:00:00 2001 From: Sunrisepeak Date: Tue, 27 Oct 2026 06:04:58 +0900 Subject: [PATCH] compat.fribidi: -fPIC on linux and macOS only; static entry points on windows clang rejects -fPIC for the MSVC target ("unsupported option '-fPIC' for target 'x86_64-pc-windows-msvc'"), and PE/COFF has no such distinction. On windows fribidi-common.h makes every entry point dllexport/dllimport unless FRIBIDI_LIB_STATIC is defined; this package builds a static library, so it is. --- pkgs/c/compat.fribidi.lua | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pkgs/c/compat.fribidi.lua b/pkgs/c/compat.fribidi.lua index f39c588e..d8e16347 100644 --- a/pkgs/c/compat.fribidi.lua +++ b/pkgs/c/compat.fribidi.lua @@ -173,10 +173,17 @@ package = { -- Upstream's own, from lib/meson.build: without it every public -- symbol would be hidden and pango would fail to link. "-DFRIBIDI_BUILD", - -- pango is linked into shared objects, so the objects must be - -- position independent. - "-fPIC", }, + -- pango is linked into shared objects, so the objects must be + -- position independent. Not on windows: PE/COFF has no such + -- distinction, and clang rejects -fPIC for the MSVC target. + linux = { cflags = { "-fPIC" } }, + macosx = { cflags = { "-fPIC" } }, + -- This is a static library: under _WIN32 fribidi-common.h would make + -- every entry point __declspec(dllexport) (dllimport for consumers) + -- unless FRIBIDI_LIB_STATIC says otherwise. A consumer that includes + -- the headers on windows defines it too. + windows = { cflags = { "-DFRIBIDI_LIB_STATIC" } }, targets = { fribidi = { kind = "lib" } }, },