Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why is gap-install linked with libgap? #5922

Open
dimpase opened this issue Jan 30, 2025 · 2 comments
Open

why is gap-install linked with libgap? #5922

dimpase opened this issue Jan 30, 2025 · 2 comments

Comments

@dimpase
Copy link
Member

dimpase commented Jan 30, 2025

In Makefile.rules one has

# build rule for the gap executable used by the `install-bin` target
build/gap-install: libgap$(SHLIB_EXT) cnf/GAP-LDFLAGS cnf/GAP-LIBS cnf/GAP-OBJS build/obj/build/main.c.o
        $(QUIET_LINK)$(LINK) $(GAP_LDFLAGS) build/obj/build/main.c.o $(GAP_LIBS) -L${abs_builddir} -lgap -o $@

endif

Does this mean that gap as installed by make install is using libgap, unlike ./gap produced by make ?

And so, in particular, packages producing GAP kernel extensions might need to be linked to libgap (we observe errors on a recent arm64 macOS to this extent).
@culler

@fingolfin
Copy link
Member

Does this mean that gap as installed by make install is using libgap, unlike ./gap produced by make ?

Yes exactly.

And so, in particular, packages producing GAP kernel extensions might need to be linked to libgap

Yup. As a general rule, you need to link a kernel extension against the kernel it is supposed to be used with, and using the sysinfo.gap resp. gac that was built / installed with that kernel, as only that is guaranteed (well, up to mistakes on our part of course) to have the correct compiler and linker flags.

@dimpase
Copy link
Member Author

dimpase commented Feb 2, 2025

I am not sure I understand what "link a kernel extension against the kernel" means. As I try the current master branch on arm64 macOS, with cd bar && ./configure --prefix=foo && make && make install, I then configure/build, say, crypting package with

./configure foo/lib/gap # sysroot.gap is there
make && make install

Then I fake installing the packages by

ln -s bar/pkg foo/share/gap/

and foo/bin/gap runs and successfully loads crypting (and runs its tests).
However, crypting.so isn't linked to anything except a system library, i.e.

% otool -L bin/aarch64-apple-darwin24-default64-kv10/crypting.so 
bin/aarch64-apple-darwin24-default64-kv10/crypting.so:
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1351.0.0)
% 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants