pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Help with security/hs-digest on Darwin/aarch64





On Aug 18, 2024, at 7:56 AM, Benny Siegert <bsiegert%gmail.com@localhost> wrote:

This is not the issue. I did the following:

1. Ran the build with „PKG_VERBOSE=1“, which gave me a command:

/opt/pkg/bin/ghc -c -fPIC -odir dist/build -Idist/build/autogen -Idist/build/global-autogen -Idist/build -Iinclude -Iexternal/crc32c/include -Idist/build/include -Idist/build/external/crc32c/include -optcxx-O2 '-optcxx-std=c++11' -pgmc /Users/bsiegert/pkgsrc/security/hs-digest/work/.cwrapper/bin/clang -hide-all-packages -no-user-package-db -package-db dist/package.conf.inplace -package-id base-4.19.1.0-inplace -package-id bytestring-0.12.1.0-inplace external/crc32c/src/crc32c.cc -Wall -optl -L/usr/lib -optl -L/opt/pkg/lib -pgmlm /usr/bin/ld -optlm -r -tmpdir /var/folders/dw/9cf3_v6917jb80637blf2hf40000gn/T/

Which fails with this error message.

2. Traced the command by prefixing it with "sudo ktrace trace -S -f C3 -c“ (thanks StackOverflow), which shows ghc looking through $PATH (and the wrong one, as it does not consider the .wrapper/bin directory) for an executable named „clang++ -std=gnu++11“. That is, something probably sets CXX to this string and GHC does not split the argument at the space.

2024-08-18 14:47:30.005520 CEST        16.0              VFS_LOOKUP                           6556e656e308241f /opt/pkg/bin/clang++ -st                           2b66b7             4(AP-P) ghc-9.8.2(69074)
2024-08-18 14:47:30.005520 CEST         0.0(0.0)         VFS_LOOKUP                           d=gnu++11                                                           2b66b7             4(AP-P) ghc-9.8.2(69074)

I hope this gives you a hint as to how to fix this, since I have no idea :)

Finally figured it out. Here's the quick fix:

--- pkg/lib/ghc-9.8.2/lib/settings.orig 2024-09-19 21:29:51
+++ pkg/lib/ghc-9.8.2/lib/settings      2024-09-19 21:30:10
@@ -3,2 +3,2 @@
-,("C++ compiler command", "clang++ -std=gnu++11")
-,("C++ compiler flags", "--target=arm64-apple-darwin ")
+,("C++ compiler command", "clang++")
+,("C++ compiler flags", "-std=gnu++11 --target=arm64-apple-darwin ")

In lang/ghc98/patches/patch-m4_fp__find__cxx__std__lib.m4 there's this:

    $CXX must not be quoted because it may contain flags. The same goes for
    $CC. This causes a configuration failure on MacOS X 14 where AC_PROG_CXX
    sets $CXX to "clang++ -std=gnu++11".

I guess macOS 15 does too. I really don't know enough about Haskell anything to know how to properly fix this.

Possibly a post-install fix to implement something like the patch above where move the compiler flags from the comiler command define to the compiler flags define.

-Jason


-- 
Jason White
jdwhite%menelos.com@localhost
Mastodon: @jdwhite%mastodon.sdf.org@localhost
"The single biggest problem in communication is the illusion that it has taken place." - George Bernard Shaw






Home | Main Index | Thread Index | Old Index