Subject: | build failure in blead |
Building a non-threaded perl currently fails when building DB_File on NetBSD.
It started failing in bafdc25d6fdf3143c875c3440a49861ff1e19000, but the failure is caused by a bug in DB_File (or at least some obsolete code.)
perl.h defines dNOOP as:
#define dNOOP extern int Perl___notused(void)
when DB_VERSION_MAJOR is undefined, DB_File.xs defines dNOOP as:
# define dNOOP extern int Perl___notused
Perl's definition changed in bafdc25d6fdf3143c875c3440a49861ff1e19000 (June 2011).
The reason Karl's commit started this failing:
He introduced a new inline function to inline.h, which uses dTHX. That is replaced by dNOOP on non-threaded builds and then with extern int Perl___notused(void), so now a declaration of the function is visible to XS.
After redefining dNOOP, DB_File.xs also uses dTHX, which is now replaced with "extern in Perl___notused" causing the error:
DB_File.xs: In function 'btree_compare':
DB_File.xs:590: error: 'Perl___notused' redeclared as different kind of symbol
../../inline.h:261: error: previous declaration of 'Perl___notused' was here
*** [DB_File.o] Error code 1
The simplest solution is probably to use a different name when you redefine dNOOP, eg:
#define dNOOP extern int DB_File___notused(void)
which will conflict with neither the old variable declaration nor the newer function declaration.
Tony