[Bug 260409] graphics/opendx fails to build when you use a few security flags

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 14 Dec 2021 07:21:08 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=260409

            Bug ID: 260409
           Summary: graphics/opendx fails to build when you use a few
                    security flags
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: stephen@FreeBSD.org
          Reporter: devosalain@ymail.com
          Assignee: stephen@FreeBSD.org
             Flags: maintainer-feedback?(stephen@FreeBSD.org)

make.conf:
MYFLAGS=" -D_FORTIFY_SOURCE=2 -D_GLIBCXX_ASSERTIONS -fident
-mno-unaligned-access -Wformat -Wformat-security -Werror=format-security -fPIC
-fPIE -fcf-protection -fexceptions -fno-short-enums -fomit-frame-pointer
-fstrict-aliasing -fstack-protector-all -fstack-protector
-fstack-protector-strong -fstack-clash-protection -O2 -pipe "
CFLAGS+="${MYFLAGS}"
CXXFLAGS+="${MYFLAGS}"

Compilation fails with log,
[00:06:42]  cc -DHAVE_CONFIG_H -I. -I. -I../../../include -I../../../include
-I./../dpexec -I/wrkdirs/usr/ports/graphics/opendx/work/dx-4.4.4/include
-Dfreebsd -O2 -pipe -D_FORTIFY_SOURCE=2 -D_GLIBCXX_ASSERTIONS -fident
-mno-unaligned-access -Wformat -Wformat-security -Werror=format-security -fPIC
-fPIE -fcf-protection -fexceptions -fno-short-enums -fomit-frame-pointer
-fstrict-aliasing -fstack-protector-all -fstack-protector
-fstack-protector-strong -fstack-clash-protection -O2 -pipe -march=ivybridge
-fstack-protector-strong -fno-strict-aliasing -D_FORTIFY_SOURCE=2
-D_GLIBCXX_ASSERTIONS -fident -mno-unaligned-access -Wformat -Wformat-security
-Werror=format-security -fPIC -fPIE -fcf-protection -fexceptions
-fno-short-enums -fomit-frame-pointer -fstrict-aliasing -fstack-protector-all
-fstack-protector -fstack-protector-strong -fstack-clash-protection -O2 -pipe
-I/usr/local/include -I/usr/local/include -O2 -pipe -D_FORTIFY_SOURCE=2
-D_GLIBCXX_ASSERTIONS -fident -mno-unaligned-access -Wformat -Wformat-security
-Werror=format-security -fPIC -fPIE -fcf-protection -fexceptions
-fno-short-enums -fomit-frame-pointer -fstrict-aliasing -fstack-protector-all
-fstack-protector -fstack-protector-strong -fstack-clash-protection -O2 -pipe
-march=ivybridge -fstack-protector-strong -fno-strict-aliasing
-I/usr/local/include -D_GNU_SOURCE -c colormap.c  -fPIC -DPIC -o
.libs/colormap.o
[00:06:42] cc: warning: argument unused during compilation:
'-mno-unaligned-access' [-Wunused-command-line-argument]
[00:06:42] cc: warning: argument unused during compilation:
'-mno-unaligned-access' [-Wunused-command-line-argument]
[00:06:42] cc: warning: argument unused during compilation:
'-mno-unaligned-access' [-Wunused-command-line-argument]
[00:06:42] colormap.c:1170:21: error: format string is not a string literal
(potentially insecure) [-Werror,-Wformat-security]
[00:06:42]       sprintf(ei.mp,name);  while(*ei.mp) ei.mp++;
[00:06:42]                     ^~~~
[00:06:42] colormap.c:1170:21: note: treat the string as an argument to avoid
this
[00:06:42]       sprintf(ei.mp,name);  while(*ei.mp) ei.mp++;
[00:06:42]                     ^
[00:06:42]                     "%s", 
[00:06:42] colormap.c:1189:18: error: format string is not a string literal
(potentially insecure) [-Werror,-Wformat-security]
[00:06:42]    sprintf(ei.mp,name); while(*ei.mp) ei.mp++;
[00:06:42]                  ^~~~
[00:06:42] colormap.c:1189:18: note: treat the string as an argument to avoid
this
[00:06:42]    sprintf(ei.mp,name); while(*ei.mp) ei.mp++;
[00:06:42]                  ^
[00:06:42]                  "%s", 
[00:06:42] 2 errors generated.
[00:06:42] gmake[5]: *** [Makefile:459: colormap.lo] Error 1
[00:06:42] gmake[5]: Leaving directory
'/wrkdirs/usr/ports/graphics/opendx/work/dx-4.4.4/src/exec/dxmods'
[00:06:42] gmake[4]: *** [Makefile:393: all] Error 2
[00:06:42] gmake[4]: Leaving directory
'/wrkdirs/usr/ports/graphics/opendx/work/dx-4.4.4/src/exec/dxmods'
[00:06:42] gmake[3]: *** [Makefile:386: all-recursive] Error 1
[00:06:42] gmake[3]: Leaving directory
'/wrkdirs/usr/ports/graphics/opendx/work/dx-4.4.4/src/exec'
[00:06:42] gmake[2]: *** [Makefile:256: all-recursive] Error 1
[00:06:42] gmake[2]: Leaving directory
'/wrkdirs/usr/ports/graphics/opendx/work/dx-4.4.4/src'
[00:06:42] gmake[1]: *** [Makefile:277: all-recursive] Error 1
[00:06:42] gmake[1]: Leaving directory
'/wrkdirs/usr/ports/graphics/opendx/work/dx-4.4.4'
[00:06:42] *** Error code 1
[00:06:42] 
[00:06:42] Stop.
[00:06:42] make: stopped in /usr/ports/graphics/opendx

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