pkgsrc-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: pkgtools/pkg_install does not compile with gcc-9 (Ubutnu 20)
On Tue, 17 Mar 2020 at 08:29, Shay Perlstein <Shay.Perlstein%tomtom.com@localhost> wrote:
>
> On Mon, 2020-03-16 at 11:35 +0000, Ottavio Caruso wrote:
> > On Mon, 16 Mar 2020 at 11:26, Shay Perlstein <
> > Shay.Perlstein%tomtom.com@localhost> wrote:
> > >
> > > On Sun, 2020-03-15 at 12:05 +0100, shay.perlstein%tomtom.com@localhost wrote:
> > > > On Sun, 2020-03-15 at 08:29 +0000, Ottavio Caruso wrote:
> > > > > On Fri, 13 Mar 2020 at 19:53, Shay Perlstein <
> > > > > Shay.Perlstein%tomtom.com@localhost> wrote:
> > > > > >
> > > > > >
> > > > > > Hi,
> > > > > > I am porting our pkgsrc setup to Ubuntu 20. One of the things
> > > > > > that
> > > > > > does not compile out of the box is pkgtools/pkg_install.
> > > > > >
> > > > > > The following error is generated:
> > > > > >
> > > > > > checking whether the C compiler works.. no
> > > > > > configure: error: in `/var/tmp/pkgsrc-
> > > > > > obj/pkgtools/pkg_install/work/libnbcompat':
> > > > > > configure: error: C compiler cannot create executables
> > > > > > See `config.log' for more details
> > > > > > *** Error code 77
> > > > > >
> > > > > > Stop.
> > > > > > bmake[1]: stopped in /usr/pkgsrc/pkgtools/pkg_install
> > > > > > *** Error code 1
> > > > > >
> > > > > >
> > > > > > Diving into the config log:
> > > > > >
> > > > > >
> > > > > > configure:3047: checking whether the C compiler works
> > > > > > configure:3069: cc -O2 -D_FORTIFY_SOURCE=2
> > > > > > -I/usr/local/pkg/include
> > > > > > -D_LARGEFILE_SOURCE -D_LARGE_FILES -D_FILE_OFFSET_BITS=64
> > > > > > -DDEF_UMASK=022 -I/var/tmp/pkgsrc-
> > > > > > obj/pkgtools/pkg_install/work/bzip2 -I/var/tmp/pkgs
> > > > > > rc-obj/pkgtools/pkg_install/work/zlib -I/var/tmp/pkgsrc-
> > > > > > obj/pkgtools/pkg_install/work/libarchive/libarchive
> > > > > > -I/var/tmp/pkgsrc-obj/pkgtools/pkg_install/work/libfetch
> > > > > > -I/var/tmp/pkgsrc-obj/pkgtools/pkg_install/wor
> > > > > > k -DHAVE_NBCOMPAT_H=1 -I/var/tmp/pkgsrc-
> > > > > > obj/pkgtools/pkg_install/work/libnbcompat
> > > > > > -I/usr/local/pkg/include
> > > > > > -Wl,-z,relro -Wl,-z,now -lssl -lcrypto -L/var/tmp/pkgsrc-
> > > > > > obj/pkgtools/pkg_install/work/bzip2 -L/var/tmp/
> > > > > > pkgsrc-obj/pkgtools/pkg_install/work/zlib -L/var/tmp/pkgsrc-
> > > > > > obj/pkgtools/pkg_install/work/libarchive/.libs
> > > > > > -L/var/tmp/pkgsrc-
> > > > > > obj/pkgtools/pkg_install/work/libfetch -L/var/tmp/pkgsrc-
> > > > > > obj/pkgtools/pkg_install/work
> > > > > > /netpgp -L/var/tmp/pkgsrc-
> > > > > > obj/pkgtools/pkg_install/work/libnbcompat
> > > > > > -L/usr/local/pkg/lib -Wl,-R/usr/local/pkg/lib conftest.c >&5
> > > > > > /tmp/cc9uaWwA.s: Assembler messages:
> > > > > > /tmp/cc9uaWwA.s:10: Error: no such instruction: `endbr64'
> > > > > > configure:3073: $? = 1
> > > > > > configure:3111: result: no
> > > > > > configure: failed program was:
> > > > > > > /* confdefs.h */
> > > > > > > #define PACKAGE_NAME "libnbcompat"
> > > > > > > #define PACKAGE_TARNAME "libnbcompat"
> > > > > > > #define PACKAGE_VERSION "20150419"
> > > > > > > #define PACKAGE_STRING "libnbcompat 20150419"
> > > > > > > #define PACKAGE_BUGREPORT "joerg%NetBSD.org@localhost"
> > > > > > > #define PACKAGE_URL ""
> > > > > > > /* end confdefs.h. */
> > > > > > >
> > > > > > > int
> > > > > > > main ()
> > > > > > > {
> > > > > > >
> > > > > > > ;
> > > > > > > return 0;
> > > > > > > }
> > > > > >
> > > > > > configure:3116: error: in `/var/tmp/pkgsrc-
> > > > > > obj/pkgtools/pkg_install/work/libnbcompat':
> > > > > > configure:3118: error: C compiler cannot create executables
> > > > > > See `config.log' for more details
> > > > > >
> > > > > > looking into the Makefile you see the following:
> > > > > >
> > > > > >
> > > > > > # These are needed to solve a chicken-and-egg problem where
> > > > > > pkgsrc
> > > > > > uses
> > > > > > # newer features of pkg_install, but older NetBSD
> > > > > > installations
> > > > > > won't
> > > > > > # support them. In this case, we explicitly use the native
> > > > > > GCC
> > > > > > # compiler to avoid problems with depending on pkgsrc GCC for
> > > > > > building
> > > > > > # pkg_install.
> > > > > > #
> > > > > > # We also use the newly built pkg_{add,create,delete} since
> > > > > > upgrading
> > > > > > # from an older pkg_install might required features of the
> > > > > > new
> > > > > > # program, provided that we are not cross-compiling. (XXX If
> > > > > > we
> > > > > > are
> > > > > > # cross-compiling, we should maybe have a host build
> > > > > > dependency
> > > > > > on
> > > > > > # ourselves...)
> > > > > > #
> > > > > > # Note that the definitions are only overriden for the phases
> > > > > > that
> > > > > > are
> > > > > > # supposed to use them. pkg_admin pmatch might be used when
> > > > > > looking for
> > > > > > # dependencies. If that is ever changed in a incompatible
> > > > > > way,
> > > > > > this
> > > > > > has to
> > > > > > # be rethought.
> > > > > > USE_NATIVE_GCC= yes
> > > > > >
> > > > > > Removing it will make the package compile on Ubuntu 20.
> > > > > >
> > > > > > Beside the actual gcc-9 issue, the other question is, why the
> > > > > > native compiler is used by default and not only on older
> > > > > > NetBSD
> > > > > > where the issue might occur?
> > > > > > I would expect pkgsrc to avoid using system compilers by
> > > > > > default,
> > > > > > especially when `PREFER_PKGSRC=yes` option is used.
> > > > >
> > > > > On a similar system:
> > > > > Linux e130 4.9.0-11-amd64 #1 SMP Debian 4.9.189-3+deb9u1 (2019-
> > > > > 09-
> > > > > 20)
> > > > > x86_64 GNU/Linux
> > > > >
> > > > > I cannot replicate your errors. pkgtools/pkg_install builds and
> > > > > installs fine here.
> > >
> > > Oops I forgot to state, we are still on NetBSD-2019Q1 branch
> > > (planning
> > > to do a migration ASAP).
> > > So assuming I am on old branch and there is no point looking into
> > > why
> > > the error occurs on that branch code, the actual question of why
> > > the
> > > system compiler is used by defualt for this package is still valid,
> > > no?
> >
> > What does `pkg_info|grep gcc` report
>
> gcc5-5.5.0nb4 The GNU Compiler Collection (GCC) - 5 Release
> Series
> gcc7-libs-7.4.0nb1 The GNU Compiler Collection (GCC) support shared
> libraries
> gcc7-7.4.0 The GNU Compiler Collection (GCC) - 7.0 Release
> Series
>
> we use pkgsrc gcc7 to compile the packages (avoiding system compiler
> and other dependencies).
>
> At the moment we patched the pkg_install package to avoid using the
> system compiler.
I would checkout current and make a second bootstrap with a separate prefix:
./bootstrap --prefer-pkgsrc yes --prefix /usr/pkg-current
and then build from current and see what comes out.
--
Ottavio Caruso
Home |
Main Index |
Thread Index |
Old Index