[Bug 240492] graphics/glew: unexpected optimizations in debug build

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Bug 240492] graphics/glew: unexpected optimizations in debug build

bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240492

            Bug ID: 240492
           Summary: graphics/glew: unexpected optimizations in debug build
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Keywords: patch
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: [hidden email]
          Reporter: [hidden email]
          Assignee: [hidden email]
             Flags: maintainer-feedback?([hidden email])

Created attachment 207372
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=207372&action=edit
blind fix

Mk/bsd.port.mk strips -O* flags by default when building WITH_DEBUG. If user
wants optimized debug build it should pass -g manually and define empty STRIP.

$ make WITH_DEBUG=
[...]
cc -DGLEW_NO_GLU -DGLEW_BUILD -pipe  -g -fstack-protector-strong
-fno-strict-aliasing  -O2 -Wall -W -Iinclude -I/usr/local/include -fPIC  -o
tmp/freebsd/default/shared/glew.o -c src/glew.c
cc -DGLEW_NO_GLU -DGLEW_STATIC -pipe  -g -fstack-protector-strong
-fno-strict-aliasing  -O2 -Wall -W -Iinclude -I/usr/local/include -fPIC  -o
tmp/freebsd/default/static/glew.o -c src/glew.c
cc -DGLEW_NO_GLU -pipe  -g -fstack-protector-strong -fno-strict-aliasing  -O2
-Wall -W -Iinclude -I/usr/local/include -fPIC -o
tmp/freebsd/default/shared/glewinfo.o -c src/glewinfo.c
cc -DGLEW_NO_GLU -pipe  -g -fstack-protector-strong -fno-strict-aliasing  -O2
-Wall -W -Iinclude -I/usr/local/include -fPIC -o
tmp/freebsd/default/shared/visualinfo.o -c src/visualinfo.c

Alternatively, a user may want to increase optimizations. To take effect CFLAGS
from the ports framework have to be passed after vendor CFLAGS.

$ CFLAGS=-Ofast make
[...]
cc -DGLEW_NO_GLU -DGLEW_BUILD -Ofast  -fstack-protector-strong
-fno-strict-aliasing  -O2 -Wall -W -Iinclude -I/usr/local/include -fPIC  -o
tmp/freebsd/default/shared/glew.o -c src/glew.c
cc -DGLEW_NO_GLU -DGLEW_STATIC -Ofast  -fstack-protector-strong
-fno-strict-aliasing  -O2 -Wall -W -Iinclude -I/usr/local/include -fPIC  -o
tmp/freebsd/default/static/glew.o -c src/glew.c
cc -DGLEW_NO_GLU -Ofast  -fstack-protector-strong -fno-strict-aliasing  -O2
-Wall -W -Iinclude -I/usr/local/include -fPIC -o
tmp/freebsd/default/shared/glewinfo.o -c src/glewinfo.c
cc -DGLEW_NO_GLU -Ofast  -fstack-protector-strong -fno-strict-aliasing  -O2
-Wall -W -Iinclude -I/usr/local/include -fPIC -o
tmp/freebsd/default/shared/visualinfo.o -c src/visualinfo.c

https://www.freebsd.org/doc/en/books/porters-handbook/dads-cflags.html

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ports-bugs
To unsubscribe, send any mail to "[hidden email]"