Content-Length: 206991 | pFad | http://github.com/heimdal/heimdal/issues/1263

42 `dbopen` autoconf check doesn't detect its presence when it's provided by `libdb` · Issue #1263 · heimdal/heimdal · GitHub
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

dbopen autoconf check doesn't detect its presence when it's provided by libdb #1263

Open
booxter opened this issue Oct 15, 2024 · 0 comments

Comments

@booxter
Copy link

booxter commented Oct 15, 2024

Describe the bug

On Linux, dbopen is not part of glibc. When compiling with libdb that has a compatibility layer for dbopen, ./configure script fails to detect that dbopen is available. The output of the check is:

| /* end confdefs.h.  */
| char dbopen (void);
| int
| main ()
| {
| dbopen()
|   ;
|   return 0;
| }
configure:17841: gcc  -o conftest -g -O2   -D_LARGE_FILES=  conftest.c  -ldb  -pthread -lpthread  >&5
conftest.c:46:9: warning: ISO C99 requires whitespace after the macro name
   46 | #define HAVE_LIBDB-5 1
      |         ^~~~~~~~~~
/nix/store/vcvhwiilizhijk7ywyn58p9l005n9sbn-binutils-2.43.1/bin/ld: /build/ccsUmbsT.o: in function `main':
/build/source/conftest.c:53:(.text.startup+0x5): undefined reference to `dbopen'
collect2: error: ld returned 1 exit status
configure:17841: $? = 1

This is because db5 defines dbopen as a macro,

/* Re-define the user's dbopen calls. */
#define dbopen __db185_open

And so it does not expose this as a dynamic library symbol:

$ readelf -a /nix/store/pxkp0mzfax9m2vrp887xjc738fifx4jf-db-5.3.28/lib/libdb.so | grep __db185_open
   818: 0000000000031c70  1330 FUNC    GLOBAL DEFAULT   12 __db185_open
   576: 0000000000031c70  1330 FUNC    GLOBAL DEFAULT   12 __db185_open
$ readelf -a /nix/store/pxkp0mzfax9m2vrp887xjc738fifx4jf-db-5.3.28/lib/libdb.so | grep dbopen
$

But on Darwin, the check succeeds, since dbopen is provided as a native symbol in libSystem.

I think the correct path is to fix autoconf check that should be able to detect the presence of dbopen macro even if there's no linker symbol for the same. This will allow to compile the v1 compat layer from lib/hdb/db.c etc. against db-5.

This was spotted in nixpkgs when trying to understand why linux and darwin builds behave differently.

To Reproduce
Steps to reproduce the behavior:

  1. nix-build -A heimdal on the latest nixpkgs which will pull db_185.h from libdb, among other things.
  2. Confirm in config.log that dbopen check returned no even though it's part of libdb C headers.

Expected behavior
dbopen is correctly detected. v1 lib/hdb/db.c layer is built.

Nixpkgs patch where this is being handled / discussed: NixOS/nixpkgs#348370

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

1 participant








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/heimdal/heimdal/issues/1263

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy