Closed jkeenan closed 2 months ago
We did stop compiling gcc on amd64 as part of the base system (although it is still available on other architectures) but you can install the "g++" package from lang/gcc, although it installs the binaries as "eg++" and "egcc". I didn't track down why there's no g++-11 package, but that old version of isn't likely to come back on amd64 so I doubt we will be able to reproduce it.
# pkg_add g++
quirks-4.93 signed on 2022-01-10T20:43:34Z
quirks-4.92->4.93: ok
g++-8.4.0p9:libmpc-1.1.0: ok
g++-8.4.0p9:gcc-8.4.0p9: ok
g++-8.4.0p9: ok
Read shared items: ok
With that, Configure (on blead) completes (dang, I need to update my laptop!):
$ sysctl kern.version
kern.version=OpenBSD 7.0-current (GENERIC.MP) #209: Wed Dec 29 15:43:32 MST 2021
deraadt@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
$ sh ./Configure -des -Dusedevel -Duseithreads \
-Doptimize="-O2 -pipe -fstack-protector -fno-strict-aliasing" -Dcc="eg++"
...
Now you must run 'make'.
If you compile perl5 on a different machine or from a different object
directory, copy the Policy.sh file from this object directory to the
new one before you run Configure -- this will help you with most of
the policy defaults.
I did find that my sparc64 still uses gcc and so has g++ available, but it too completes just fine.
$ sysctl kern.version
kern.version=OpenBSD 7.0-current (GENERIC.MP) #1127: Sun Jan 2 13:48:00 MST 2022
deraadt@sparc64.openbsd.org:/usr/src/sys/arch/sparc64/compile/GENERIC.MP
$ g++ --version
g++ (GCC) 4.2.1 20070719
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
We did stop compiling gcc on amd64 as part of the base system (although it is still available on other architectures) but you can install the "g++" package from lang/gcc, although it installs the binaries as "eg++" and "egcc". I didn't track down why there's no g++-11 package, but that old version of isn't likely to come back on amd64 so I doubt we will be able to reproduce it.
# pkg_add g++ quirks-4.93 signed on 2022-01-10T20:43:34Z quirks-4.92->4.93: ok g++-8.4.0p9:libmpc-1.1.0: ok g++-8.4.0p9:gcc-8.4.0p9: ok g++-8.4.0p9: ok Read shared items: ok
@afresh1, thanks for looking into this. Unfortunately, I tried gcc
, devel/gcc
and g++
without success. I control this VM via a Vagrantfile, to which I added:
# Per afresh1 recommendation Jan 12 2022
sudo pkg_add -u \
devel/gcc \
g++
I then provisioned, and got:
$ vagrant provision
==> default: Running provisioner: shell...
default: Running: inline script
default: perl-reporter-11
default: quirks-3.633 signed on 2021-10-07T19:06:22Z
default: quirks-3.633 signed on 2021-10-07T19:06:22Z
default: quirks-3.633 signed on 2021-10-07T19:06:22Z
default: quirks-3.633 signed on 2021-10-07T19:06:22Z
default: Can't find devel/gcc
default: Can't find g++
default: Problem finding devel/gcc
default: Problem finding g++
For the record:
$ uname -mrs
OpenBSD 6.9 amd64
Do you know what I'm missing?
Thank you very much. Jim Keenan
well, "devel/gcc" is the portspath, I wouldn't expect that to work for pkg_add. I'm less sure about "g++" as I see the package available for 6.9. I think the problem is the -u
which means "update" the installed packages and since you don't currently have either "gcc" or "g++" installed it isn't sure what you want.
I next tried this:
sudo pkg_add \
g++
vagrant reload
simply passed over it, and when I went in to the VM the g++
version remained at g++ (GCC) 4.2.1 20070719.
I then tried:
sudo pkg_add \
g++-8.4
At this, vagrant reload
reported:
default: perl-reporter-11
default: quirks-3.633 signed on 2021-10-07T19:06:22Z
default: quirks-3.633 signed on 2021-10-07T19:06:22Z
default: quirks-3.633 signed on 2021-10-07T19:06:22Z
default: quirks-3.633 signed on 2021-10-07T19:06:22Z
default: quirks-3.633 signed on 2021-10-07T19:06:22Z
default: Can't find g++-8.4
default: Couldn't install g++-8.4
I'm surprised to see that g++ tarball at https://cdn.openbsd.org/pub/OpenBSD/6.9/packages/amd64/ when there is no correponding port at https://openports.se/.
Ya, that's weird, but it's a subpackage of gcc. It is listed on the much better openports.pl although there is apparently a bug that means you can't see the details.
The package installs "g++" and "gcc" as "eg++" and "egcc" so "gcc" will still be the old one.
I'm closing this ticket in favor of the nearly identically named https://github.com/Perl/perl5/issues/21958. Please continue discussion there.
If I try to compile perl on OpenBSD using g++ as the C-compiler,
./Configure
hangs; I never get as far asmake
.I have a VM which I mainly use for smoke-testing blead and branches:
I've tried to compile both blead and the recent smoke-me/nicholas/pthreads-not-_Thread_local-for-C++ branch with the following invocation:
./Configure
hangs here:./Configure
does complete if I either (a) switch-Dcc="g++"
to-Dcc=gcc
; or (b) omit the-Dcc
term entirely and default toclang-10.0.1
as the compiler. The double quotes aroundg++
don't appear to make a difference. If I simplify the invocation tosh ./Configure -des -Dusedevel -Dcc=g++
,./Configure
still hangs at the same point. (Output of./Configure
available upon request.)Other than doing this smoke-testing and maintaining a few ports of CPAN modules, I don't know much about OpenBSD. The
gcc
andg++
versions are old but appear to be part of the past system, meaning they're not available via ports. (Cf. Openports.) So trying a more recent version ofg++
doesn't seem to be an option.On SmokeDB we have no smoke-test reports on OpenBSD using
g++
as the C-compiler.I don't know how concerned we should be about this, but the fact that it is
./Configure
that is hanging is what is really surprising.@afresh1 or anyone else ... ideas?