[Buildroot] [PATCH 1/2] package/berkeleydb: add option for historic dbm interface

Thomas Petazzoni thomas.petazzoni at bootlin.com
Tue Aug 8 19:48:34 UTC 2023


Hello,

On Tue, 08 Aug 2023 18:01:40 +0200
Bernd Kuhls <bernd at kuhls.net> wrote:

> the problem I am fixing is only about the detection during configure and 
> unrelated to the code of the dbm module.

I understand, but it raises additional questions.

> The detection logic in Python 3.11 tries to link a sample program 
> containing "dbm_open()" to -ldb: https://github.com/python/cpython/blob/
> d2340ef25721b6a72d45d4508c672c4be38c67d3/configure.ac#L4007
> 
> and fails, for whatever reason:
> conftest.c:(.text.startup+0x8): undefined reference to `__db_ndbm_open'

Absolutely, this is understood.

> The detection in Python 3.10 is aimed only at the existence of the library 
> file and does not try to link code: https://github.com/python/cpython/
> blob/b4e48a444ea02921ce4b701fe165e6cfd4cf5845/setup.py#L1430C34-L1430C65

Correct.

> > So I'm really confused. How does it work in Python 3.10 ? Did we already
> > need the historic dbm interface back then ?  
> 
> Me, too, but only because my knowledge about C functions, macro expansion 
> etc. is very limited, I can not comment your analysis why the dbm module 
> works despite missing symbols. Anyway, with Python 3.11 the dbm module is 
> not build at all atm.

Yes, I understand that, but rather than "blindly" fixing the issue, I'd
like to understand what is happening. Indeed, as I explained in
previous e-mail, the dbm module in Python 3.10 is *already* using
__db_ndbm_open(), which isn't provided by libdb-5.3.so, so I'm really
confused on how it can work today. Perhaps we have an existing issue in
Python 3.10, and your change needs to also be backported to our
maintenance branch? This is why understand what's happening is
important.

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com



More information about the buildroot mailing list