# Problems upgrading ports on an iBook G4



## MarkG108 (Mar 15, 2020)

Hello.  I have been trying to install X.Org on an iBook G4, but have not succeeded.  So, currently I only have the command line going. 

A solution I found when searching the forums was to first install llvm80, but I am unable to get llvm80 properly installed (and thus have still not been able to install X.Org. 

Here's the last feedback I received when I tried to install llvm80:

```
Please submit a full bug report, with prepocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
gmake[11]: *** [/usr/ports/lang/gcc9/work/gcc-9.2.0/gcc/c/Make-lang,in:124: s-selftest-c] Error 1
gmake[11]: Leaving directory '/usr/ports/lang/gcc9/work/.build/gcc'
gmake[10]: *** [Makefile:4662: all-stage1-gcc] Error 2
gmake[10]: Leaving directory '/usr/ports/lang/gcc9/work/.build/'
gmake[9]: *** [Makefile:22474]: stage1-bubble] Error 2
gmake[9]: Leaving directory '/usr/ports/lang/gcc9/work/.build/'
gmake[8]: *** [Makefile:22806: bootstrap-lean] Error 2
gmake[8]: Leaving directory '/usr/ports/lang/gcc9/work/.build'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to the maintainer.
*** Error code 1

Stop.
make[7]: stopped in /usr/ports/lang/gcc9
*** Error code 1

Stop.
make[6]: stopped in /usr/ports/lang/gcc9
*** Error code 1

Stop.
make[5]: stopped in /usr/ports/devel/pcre
*** Error code 1

Stop.
make[4]: stopped in /usr/ports/devel/pcre
*** Error code 1

Stop.
make[3]: stopped in /usr/ports/devel/swig30
*** Error code 1

Stop.
make[2]: stopped in /usr/ports/devel/swig30
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/devel/llvm80
*** Error code 1

Stop.
make: stopped in /usr/ports/devel/llvm80
```

There's other issues here too, which concerned gcc9.

I have done a search on this, and saw that a patch was made to correct issues with gcc9, stemming from PR 242506, and that this patch became part of an upgrade on gcc9, and yet, I have not been able to implement this upgrade.  In rereading the bug report now, I see that it's no longer closed, so perhaps that explains my issues.

I did try upgrading with both `portmaster -a` and `portupgrade -a`, but both failed to completely upgrade the packages (particularly the ones of concern).  Here is the feedback from the last attempt at `portmaster -a`


```
make[2]: stopped in /usr/ports/lang/perl5.30/work/perl-5.30.1
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to the maintainer.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/lang/perl5.30
*** Error code 1

Stop.
make: stopped in /usr/ports/lang/perl5.30

===>>> make build failed for lang/perl5.30
===>>> Aborting update

===>>> Update for perl5-5.30.0 failed
===>>> Aborting update

===>>> Update for lang/gcc9 failed
===>>> Aborting update

===>>> Update for devel/jsoncpp failed
===>>> Aborting update

===>>> Update for devel/cmake failed
===>>> Aborting update

===>>> Update for devel/libepoll-shim failed
===>>> Aborting update

The following actions were performed:
     Installation of archivers/liblza (liblz4-1.9.2_1,1)
     Installation of archivers/lzo2 (lzo2-2.10_1)
     Installation of archivers/libarchive (libarchive-3.4.2,1)
     Installation of devel/ninja (ninja-1.10.0.2)
     Installation of devel/meson (meson-0.53.2)

====>>> You can restart from the point of failure with this command line:
                 portmaster <flags> devel/libepoll-shim devel/cmake devel/jsoncpp lang/gcc9 lang/perl5.30 print/texinfo misc/help2man devel/libuv ftp/curl www/libnghttp2 security/rhash devel/bison graphics/wayland
```

All suggestions are welcome.


----------



## JohnnySorocil (Mar 15, 2020)

Maybe you run out of RAM/swap space? You can check it in dmesg if there is something killed if your system runs out of swap space


----------



## MarkG108 (Mar 15, 2020)

`dmesg` says,

```
warning: total configured swap (925459 pages) exceeds maximum recommended amount (238336).
warning: increase kern.maxswzone or reduce amount of swap.
```

So, it says I have too much swap space.  Perhaps changing the swap size would help.  I'm not sure how I can permanently change the size of the swap since I can't find a GParted CD for the PowerPC architecture.  But, just to test, I'm rerunning `portmaster -a` after having turned off the swap via `swapoff -a`.  I'll see if it works.

[..]

Well, it didn't work.  

I think when I first installed FreeBSD that I just went with the defaults from the install disk.  So, I'm not sure why the swap size would be off.  Anyway, I think for now there's not much I can do.  I likely should investigate getting more RAM in this laptop, though.


----------



## MarkG108 (Mar 16, 2020)

Recent feedback from `portupgrade -a`:

```
Stop.
make: stopped in /usr/ports/devel/bison
*** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade20400206-23591-lunypd env UPGRADE_TOOL=portupgrade UPGRADE_PORT=bison-3.4.2.1 UPGRADE_PORT_VER=3.4.2.1 make
** Fix the problem and try again.
** Listing the failed packages (-;ignored / *:skipped / !:failed)
  ! lang/perl5.30 (perl5-5.30.0) (new compiler error)
  ! devel/libepoll-shim (libepoll-shim-0.0.20190311)  (segmentation fault)
  * graphics/wayland (wayland-1.16.0_1)
  * misc/help2man (help2man-1.47.11)
  * print/texinfo (texinfo-6.6_4,1)
  * ! devel/bison (bison-3.4.2,1)  (segmentation fault)
```
Well, I think until that's fixed, I won't be able to get X.Org installed.


----------



## George (Mar 16, 2020)

Use pkg. Compiling all the dependencies of the xorg port will take ages.
E.g. `pkg install xorg`, or in case of llvm80 `pkg install llvm80`
5.3. Installing Xorg - FreeBSD www.freebsd.org › doc › handbook › x-install

To resize a swap partition, use gpart resize, e.g. if your swap partition is ada1p3, use `gpart resize -s 20G -i 3 ada1`.
To change kern.maxswzone, add kern.maxswzone=".." to /boot/loader.conf. And replace .. with some size.


----------



## JohnnySorocil (Mar 16, 2020)

One "trick" I use on my amd64 machines when compiling something is to install packages missing for build and mark it as automatic dependency so they can be easily removed:

```
cd /usr/ports/*/port-name
pkg install -A $(make missing)
make -j4 install
...
pkg autoremove
```
That way I can save time on skipping to build texinfo, bison, llvm, py* and similar packages


----------



## PMc (Mar 16, 2020)

MarkG108 said:


> `dmesg` says,
> 
> ```
> warning: total configured swap (925459 pages) exceeds maximum recommended amount (238336).
> ...



This can usually be ignored. It tends to happen on various 32bit archs and is only a recommendation. If an actual fault happens because of this, real error messages should appear.



> I'm not sure how I can permanently change the size of the swap since I can't find a GParted CD for the PowerPC architecture.



Would the thing understand GPT? I doubt it.



MarkG108 said:


> Recent feedback from `portupgrade -a`:
> 
> ```
> Stop.
> ...



This is probably a Rel.12 problem. In 11.3 (and ports of 2020Q1) bison builds.


----------



## MarkG108 (Mar 17, 2020)

PMc said:


> This can usually be ignored. It tends to happen on various 32bit archs and is only a recommendation. If an actual fault happens because of this, real error messages should appear.


I saw no real error message.  However, it did inspire me to go to the used computer store in my neighbourhood and pick up some extra RAM.  So, while the total swap still exceeds the recommended amount, it's by less now.  And I'm guessing the laptop will work better.


PMc said:


> This is probably a Rel.12 problem. In 11.3 (and ports of 2020Q1) bison builds.


Good to know.  Hopefully it gets fixed at some point.

[edit]

Just to respond to a post that suggested I use `pkg`.  It seems there are no compiled packages for the PowerPC architecture.

```
root@:/usr/ports/devel/llvm80 # pkg search -o llvm80
pkg: Repository FreeBSD missing. 'pkg update' required
pkg: http://pkg.FreeBSD.org/FreeBSD:12:powerpc/quarterly/meta.txz: No address record
pkg: http://pkg.FreeBSD.org/FreeBSD:12/powerpc/quarterly/packagesite.txz: No address record
root@:/usr/ports/devel/llvm80 # pkg update
Updating FreeBSD repository catalogue...
pdg: http://pkg.FreeBSD.org/FreeBSD:12:powerpc/quarterly/meta.txz: No address record
repository FreeBSD has no meta file, using default settings
pkg: http://pkg.FreeBSD.org/FreeBSD:12:powerpc/quarterly/packagesite.txz: No address record
Unable to update repository FreeBSD
Error updating repositories!
```


----------



## PMc (Mar 17, 2020)

MarkG108 said:


> I saw no real error message.



You likely would see it, it would probably emanate a system hang. The background is, the system needs some space in RAM to manage the swap (to be reserved at boot), but the swap can fragment, so it is not easy to compute how much such space is actually needed. It should be configureable with `kern.maxswzone`, but I wasn't able to figure out how that might be correctly set, it's a somehow weird (and probably broken) math. 
This did concern i386, but then people went for amd64, and nobody cared anymore.



> However, it did inspire me to go to the used computer store in my neighbourhood and pick up some extra RAM.  So, while the total swap still exceeds the recommended amount, it's by less now.  And I'm guessing the laptop will work better.



That's never a bad idea.



> Good to know.  Hopefully it gets fixed at some point.



I'm not certain it is a Rel.12 problem, or something else. I just had an old miniMac on my garbage pile, and recently figured that thing can actually run FreeBSD. Not sure what to do with it (it would fit in my safe, so maybe lock it in there and make it the Kerberos server), but I gave it a try and installed it. And when I wanted bash, I just said, make install, and (after quite a while) the bash was there - including perl and bison.

But I have another problem now: the locale doesn't work.


----------



## MarkG108 (Mar 17, 2020)

```
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to the maintainer.
```
How does one go about doing that?


----------

