NetBSD / pkgsrc

Automatic conversion of the NetBSD pkgsrc CVS module, use with care
https://www.pkgsrc.org
310 stars 164 forks source link

pkgtools/libnbcompat: unable to compile with GCC 11 (default compilers Ubuntu 22.04) #120

Closed bartoszkosiorek closed 5 months ago

bartoszkosiorek commented 1 year ago

Steps to introduce on Ubuntu 22.04:

sudo apt-get update && sudo apt-get install gcc-multilib g++-multilib

More info about package: https://packages.ubuntu.com/jammy/gcc-multilib

When I tried to compile pkgtools/libnbcompat with GCC 11 and G++ 11 (default compiler Ubuntu 22.04) I had following compilation error:

 getopt_long.c: In function ‘getopt_internal’:
 getopt_long.c:194:6: error: ‘optreset’ undeclared (first use in this function); did you mean ‘optopt’?
   if (optreset)
       ^~~~~~~~
       optopt
 getopt_long.c:194:6: note: each undeclared identifier is reported only once for each function it appears in
 *** [getopt_long.o] Error code 1

After installing gcc 9/g++ 9 the build is successfull:

sudo apt-get update && sudo apt-get install gcc-9-multilib g++-9-multilib

More info about package: https://packages.ubuntu.com/jammy-updates/gcc-9-multilib

bartoszkosiorek commented 1 year ago

@jsonn Do you know with who I could contact to help adding support for GCC 11?

jsonn commented 1 year ago

config.log please, the real problem is elsewhere.