Re: set : illegal option -o pipefail error while trying to upgrade pkg.

From: Jamie Landeg-Jones <jamie_at_catflap.org>
Date: Thu, 01 Feb 2024 12:13:58 UTC
Mario Marietto <marietto2008@gmail.com> wrote:

> Jamie. Your script didn't work,but I get your idea and I've backed up the
> directory /mnt/da0p2/usr/ports/Mk/Scripts to
> /mnt/da0p2/usr/ports/Mk/Scripts-old ; then I have upgraded the ports tree
> with the commands :
>
> # portsnap fetch extract
> # portsnap fetch update
>
> At this point I have renamed the directory Scripts-old to Scripts and I
> tried to compile a port. This is what happened :
>
> Invoked as: ./configure --prefix=/usr/local
> Tclsh: /usr/ports/ports-mgmt/pkg/work/pkg-1.20.9/jimsh0
> Failed: cc -O2 -pipe -Wno-error -fstack-protector-strong
> -fno-strict-aliasing -c conftest__.c -o conftest__.o
> cc: error: unknown argument: '-fstack-protector-strong'
> ============
> The failed code was:
> #include <stdlib.h>
> int main(void) {
>
> return 0;
> }
> ============

Ah ok, so you've got around the pipefail issue. This is a different issue.

stack-protection got added to the clang compiler long after the freebsd version
you are using.

I think you can disable this by adding SSP_CFLAGS="" to your make command line,

e.g.

make SSP_CFLAGS=""

But then, you're likely to get build errors due to the old version of "make" on
that system, so unless you know how to remove the problem in the makefile, you'll
need a more recent version of "make" too...