![]() |
|
NetBSD Package System (pkgsrc) Installation and upgrading of packages on NetBSD. |
![]() |
|
Thread Tools | Display Modes |
|
|||
![]()
I'm using the cpuflags package:
Code:
$ make show-var VARNAME=COPTS -pipe $ make show-var VARNAME=CPUFLAGS $ make show-var VARNAME=CPU_FLAGS -mfpmath=sse -msse3 -march=native |
|
||||
![]()
About CFLAGS, vs COPTS, CPUFLAGS, CPU_FLAGS:
My original /etc/mk.conf file from many years ago used CFLAGS only. This document still recommends it https://www.netbsd.org/docs/pkgsrc/configuring.html I then found COPTS and CPUFLAGS in man mk.conf. It's not clear to me if that is only used for building the kernel and userland or also for pkgsrc. Sensucht94 also uses CPUFLAGS in his fancy /etc/mk.conf file http://daemonforums.org/showthread.php?t=11326 My ultimate goal is to rebuild pkgsrc with debug symbols so I can analyze core files. What I have now in /etc/mk.conf Code:
CPUFLAGS+= -march=native COPTS+= -g -O2 -pipe CFLAGS+= -g Code:
/usr/pkgsrc/graphics/xli# make show-var VARNAME=COPTS -g -O2 -pipe /usr/pkgsrc/graphics/xli# make show-var VARNAME=CFLAGS -O2 -g -D_FORTIFY_SOURCE=2 /usr/pkgsrc/graphics/xli# make show-var VARNAME=CPUFLAGS -march=native /usr/pkgsrc/graphics/xli# make clean; make /usr/pkgsrc/graphics/xli# gdb /var/tmp/pkgsrc/graphics/xli/work/xli-2005-02-27/xli ... Reading symbols from /var/tmp/pkgsrc/graphics/xli/work/xli-2005-02-27/xli... (No debugging symbols found in /var/tmp/pkgsrc/graphics/xli/work/xli-2005-02-27/xli) |
|
||||
![]() Quote:
I just tried a package based on ./configure and there my flags are passed through and debugging symbols are found. Code:
Reading symbols from /var/tmp/pkgsrc/devel/yasm/work/yasm-1.3.0/yasm... |
|
||||
![]()
I experimented with CFLAGS, COPTS, CPUFLAGS, CPU_FLAGS adding -g.
I only find debugging symbols in the binary when -g is passed via CFLAGS. Sensucht94 and thirdm, I recommend you double-checking your optimization flags. You may find I'm right and only CFLAGS (and CXXFLAGS for g++) are passed the compiler. |
|
||||
![]()
What seems to work for all tested packages is creating this wrapper
Code:
$ cat /opt/bin/gcc /usr/bin/gcc -g $* Same for g++. Not elegant, but hey. I hesitate putting my fancy CFLAGS into this wrapper so that also xli and other non-configure based packages benefit from custom CFLAGS, because some package Makefiles do magic transformations of CLFAGS. |
|
|||
![]()
For myself I don't want to add any custom wrappers around gcc. pkgsrc does more than enough wrapping itself for my taste.
I'm new to pkgsrc and NetBSD, but my guess is that this is one of those things that we cannot expect pkgsrc itself to solve. Maybe xli (and others you've tried?) is one of those packages made to ignore custom flags and needs to be patched. See section 10.15 of the pkgsrc guide. |
![]() |
Tags |
cflags, pkgsrc |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
New to OpenBSD, could use some help on some issues and possible optimization options | therue | OpenBSD General | 27 | 17th November 2019 02:11 PM |
flags in vi's man page | attilio | OpenBSD Packages and Ports | 4 | 13th December 2016 12:34 PM |
openbsd server optimization | barti | OpenBSD General | 18 | 30th July 2012 02:52 PM |
Which is the significance about pkgsrc-2009Q2 and pkgsrc-2009Q3? | aleunix | NetBSD Package System (pkgsrc) | 3 | 16th December 2009 07:19 AM |
FreeBSD Kernel Optimization | komodo | FreeBSD General | 5 | 22nd June 2009 07:15 AM |