[Bug 236565] [PATCH] Mk/bsd.port.mk: /etc/make.conf included twice by FreeBSD make

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sat Mar 16 01:37:46 UTC 2019


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=236565

            Bug ID: 236565
           Summary: [PATCH] Mk/bsd.port.mk: /etc/make.conf included twice
                    by FreeBSD make
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: Individual Port(s)
          Assignee: ports-bugs at FreeBSD.org
          Reporter: rozhuk.im at gmail.com

Created attachment 202895
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=202895&action=edit
patch

I spent some time while debugging math/mprime build, then build:
...
cc -O2 -pipe -O2 -DSTRIP_FBSDID -pipe -D_FORTIFY_SOURCE=2 -mretpoline 
-fstack-protector-all -fno-strict-aliasing  -O2 -DSTRIP_FBSDID -pipe
-D_FORTIFY_SOURCE=2 -mretpoline -I.. -I../sqlite-amalgamation-3180000 -DX86_64
-c gwnum.c
...

where:
-O2 -pipe - from /usr/share/mk/sys.mk
-O2 -DSTRIP_FBSDID -pipe -D_FORTIFY_SOURCE=2 -mretpoline - mine /etc/make.conf
-fstack-protector-all -fno-strict-aliasing - from /usr/ports/Mk/bsd.port.mk,
/usr/ports/Mk/bsd.ssp.mk
-I.. -I../sqlite-amalgamation-3180000 -DX86_64 -c gwnum.c - port makefile

this options added twice:
-O2 -DSTRIP_FBSDID -pipe -D_FORTIFY_SOURCE=2 -mretpoline

first time then you call make to on make file in ports tree,
second then ports trying to build port.
If use gmake to build port then this not happen.

This can be problem, because ports build system does not control
CFLAGS and other staff that in /etc/make.conf.
For example if you try build mprime using gcc - it fail, because
gcc does not support -mretpoline.
/usr/ports/Mk/bsd.gcc.mk - handle this and remove first -mretpoline,
but second -mretpoline added after run MAKE_CMD.

To prevent second include /etc/make.conf this must be done:
__MAKE_CONF=/dev/null
It can be added to /etc/make.conf, /usr/ports/Mk/bsd.port.mk or
port Makefile.

Some ports already done this.
I add to /etc/make.conf and buld dozen ports without isses.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-ports-bugs mailing list