On Wed, Jan 29, 2025 at 11:52 AM Marc Culler <marc.cul...@gmail.com> wrote:
>
> I don't have time for that right now.  But I will provide a patch for the 
> 1-line fix that I used:
>
> diff --git a/build/pkgs/gap_packages/spkg-install.in 
> b/build/pkgs/gap_packages/spkg-install.in
> index 7005cc3d322..157e093d86b 100644
> --- a/build/pkgs/gap_packages/spkg-install.in
> +++ b/build/pkgs/gap_packages/spkg-install.in
> @@ -96,6 +96,7 @@ do
>      echo "Building GAP package $pkg"
>      CFLAGS="$CFLAGS -Wno-implicit-function-declaration"
>      export CFLAGS
> +    export LDFLAGS="$LDFLAGS -lgap"
>      cd "$PKG_SRC_DIR/$pkg"
>      ./configure "$GAP_ROOT"
>      sdh_make -j1

This is not a correct fix. libgap is not really involved here;
cypring's GAP kernel module
(that's what's compiled here) can be loaded either in libgap, or in
gap executable - and the latter
isn't linked to libgap.

The correct fix should be to clean up various CFLAGS and LDFLAGS, it seems.
Indeed, I cannot reproduce this on a stand-alone GAP 4.13.1 build
(with crypting package).

Here what the flags are with the successful stand-alone build:

dima@studio crypting % ./configure
Using settings from ../../sysinfo.gap
dima@studio crypting % make V=1
"/tmp/gap-4.13.1/gac" -d -p "    " -P " " src/crypting.c -o
bin/aarch64-apple-darwin24-default64-kv9/crypting.so
gcc -pthread -g -O2 -fno-common -o
/var/folders/81/vt06lnj17rj0cpc9gdshy4q00000gr/T/gacXXXXXXX.4ENWuVAZjc/79411_crypting.o
-I/tmp/gap-4.13.1/build -I/tmp/gap-4.13.1/src -I/tmp/gap-4.13.1
-DUSE_GASMAN=1 -c src/crypting.c
gcc -o bin/aarch64-apple-darwin24-default64-kv9/crypting.so
/var/folders/81/vt06lnj17rj0cpc9gdshy4q00000gr/T/gacXXXXXXX.4ENWuVAZjc/79411_crypting.o
-bundle -flat_namespace -bundle_loader /tmp/gap-4.13.1/gap
rm -f 
/var/folders/81/vt06lnj17rj0cpc9gdshy4q00000gr/T/gacXXXXXXX.4ENWuVAZjc/79411_crypting.o
dima@studio crypting %

Dima

>
> - Marc
>
> On Wed, Jan 29, 2025 at 11:42 AM Dima Pasechnik <dimp...@gmail.com> wrote:
>>
>> On Wed, Jan 29, 2025 at 11:39 AM Marc Culler <marc.cul...@gmail.com> wrote:
>> >
>> > The missing symbols are defined in libgap and I was able to build 
>> > gap_packages after adding -lgap to LDFLAGS in spkg-install.in.
>> yes, I can reproduce this with the latest beta5, on Apple clang
>> version 16.0.0 (clang-1600.0.26.4), on an arm64 (M1) box.
>>
>> Will you do a PR to fix this?
>>
>>
>> >
>> > - Marc
>> >
>> > On Wednesday, January 29, 2025 at 10:16:23 AM UTC-6 Marc Culler wrote:
>> >>
>> >> Wish Sage 10.6beta4 On an M1 macOS 15.3 system with CommandLineTools 
>> >> 16.2.0.0.1.1733547573, the gap_packages-14.13.1 build is failing for me.
>> >> (The build worked on an Intel system with XCode 16.0.0.0.1.1726343358).
>> >>
>> >> The linker errors are (full log attached):
>> >>
>> >> [spkg-install] gcc -o 
>> >> bin/aarch64-apple-darwin24-default64-kv9/crypting.so 
>> >> /var/folders/20/gvp6qws53xg610l741x6k_480000gn/T/gacXXXXXXX.r41KPjrB8W/56064_crypting.o
>> >>  -bundle -flat_namespace -bundle_loader
>> >> /private/var/tmp/sage-10.6-current/local/bin/gap 
>> >> -L/private/var/tmp/sage-10.6-current/local/lib 
>> >> -L/private/var/tmp/sage-10.6-current/local/lib 
>> >> -Wl,platform_version,macos,11.0,11.1 -L/Library/Developer/
>> >> CommandLineTools/SDKs/MacOSX.sdk/usr/lib
>> >> [spkg-install] Undefined symbols for architecture arm64:
>> >> [spkg-install]   "_ChangedBags", referenced from:
>> >> [spkg-install]       _FuncCRYPTING_SHA256_UPDATE in 56064_crypting.o
>> >> [spkg-install]       _FuncCRYPTING_SHA256_FINAL in 56064_crypting.o
>> >> [spkg-install]       _FuncCRYPTING_SHA256_FINAL in 56064_crypting.o
>> >> [spkg-install]       _FuncCRYPTING_SHA256_FINAL in 56064_crypting.o
>> >> [spkg-install]       _FuncCRYPTING_SHA256_FINAL in 56064_crypting.o
>> >> [spkg-install]       _FuncCRYPTING_SHA256_FINAL in 56064_crypting.o
>> >> [spkg-install]       _FuncCRYPTING_SHA256_FINAL in 56064_crypting.o
>> >> [spkg-install]       _FuncCRYPTING_SHA256_FINAL in 56064_crypting.o
>> >> [spkg-install]       _FuncCRYPTING_SHA256_FINAL in 56064_crypting.o
>> >> [spkg-install]       _FuncCRYPTING_SHA256_FINAL in 56064_crypting.o
>> >> [spkg-install]       ...
>> >> [spkg-install]   "_ErrorQuit", referenced from:
>> >> [spkg-install]       _FuncCRYPTING_SHA256_UPDATE in 56064_crypting.o
>> >> [spkg-install]       _FuncCRYPTING_SHA256_HMAC in 56064_crypting.o
>> >> [spkg-install]   "_ImportGVarFromLibrary", referenced from:
>> >> [spkg-install]       _InitKernel in 56064_crypting.o
>> >> [spkg-install]   "_InitGVarFuncsFromTable", referenced from:
>> >> [spkg-install]       _InitLibrary in 56064_crypting.o
>> >> [spkg-install]   "_InitHdlrFuncsFromTable", referenced from:
>> >> [spkg-install]       _InitKernel in 56064_crypting.o
>> >> [spkg-install]   "_IsStringFuncs", referenced from:
>> >> [spkg-install]       _FuncCRYPTING_SHA256_UPDATE in 56064_crypting.o
>> >> [spkg-install]       _FuncCRYPTING_SHA256_HMAC in 56064_crypting
>> >> [spkg-install]   "_NewBag", referenced from:
>> >> [spkg-install]       _FuncCRYPTING_SHA256_INIT in 56064_crypting.o
>> >> [spkg-install]       _FuncCRYPTING_SHA256_FINAL in 56064_crypting.o
>> >> [spkg-install]       _FuncCRYPTING_SHA256_HMAC in 56064_crypting.o
>> >> [spkg-install]   "_ObjInt_UInt", referenced from:
>> >> [spkg-install]       _FuncCRYPTING_SHA256_FINAL in 56064_crypting.o
>> >> [spkg-install]       _FuncCRYPTING_SHA256_FINAL in 56064_crypting.o
>> >> [spkg-install]       _FuncCRYPTING_SHA256_FINAL in 56064_crypting.o
>> >> [spkg-install]       _FuncCRYPTING_SHA256_FINAL in 56064_crypting.o
>> >> [spkg-install]       _FuncCRYPTING_SHA256_FINAL in 56064_crypting.o
>> >> [spkg-install]       _FuncCRYPTING_SHA256_FINAL in 56064_crypting.o
>> >> [spkg-install]       _FuncCRYPTING_SHA256_FINAL in 56064_crypting.o
>> >> [spkg-install]       _FuncCRYPTING_SHA256_FINAL in 56064_crypting.o
>> >> [spkg-install]       ...
>> >> [spkg-install]   "_SET_TYPE_OBJ", referenced from:
>> >> [spkg-install]       _FuncCRYPTING_SHA256_INIT in 56064_crypting.o
>> >> [spkg-install]   "_YoungBags", referenced from:
>> >> [spkg-install]       _FuncCRYPTING_SHA256_UPDATE in 56064_crypting.o
>> >> [spkg-install]       _FuncCRYPTING_SHA256_FINAL in 56064_crypting.o
>> >> [spkg-install]       _FuncCRYPTING_SHA256_HMAC in 56064_crypting.o
>> >> [spkg-install] ld: symbol(s) not found for architecture arm64
>> >> [spkg-install] clang: error: linker command failed with exit code 1 (use 
>> >> -v to see invocation)
>> >> [spkg-install] make[5]: *** 
>> >> [bin/aarch64-apple-darwin24-default64-kv9/crypting.so] Error 1
>> >> [spkg-install] 
>> >> ********************************************************************************
>> >> [spkg-install] Error building gap_packages-4.13.1
>> >> [spkg-install] 
>> >> ********************************************************************************
>> >>
>> > --
>> > You received this message because you are subscribed to the Google Groups 
>> > "sage-devel" group.
>> > To unsubscribe from this group and stop receiving emails from it, send an 
>> > email to sage-devel+unsubscr...@googlegroups.com.
>> > To view this discussion visit 
>> > https://groups.google.com/d/msgid/sage-devel/b3249c92-08bf-4485-8eda-e32a5f42e459n%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/sage-devel/CAAWYfq3JxzvfomQRre%3DF3S43sDB8nR4xei5j%3DyPDYvNCVrsiVg%40mail.gmail.com.

Reply via email to