Bug #2063
closedPosition Independent Executables (PIE) create unwanted gmon files
0%
Description
Using DragonFly BSD 2.10.1 Release, PIE programs like Samba35 and cups create
gmon profiling files. For example, the samba net command creates a file called
net.gmon. After a while, the file system is littered with these gmon files. They
cause no harm, but are not wanted.
The file src/lib/csu/i386/Makefile.csu has the profiling flag -DGCRT on the
Scrt1_c.o line. The -DGCRT flag should not be present on this line.
24 Scrt1_c.o: crt1_c.c
25 ${CC} ${CFLAGS} -DGCRT -fPIC -DPIC -c -o Scrt1_c.o ${CSUDIR}/crt1_c.c
The fix is to remove the -DGCRT flag.
24 Scrt1_c.o: crt1_c.c
25 ${CC} ${CFLAGS} -fPIC -DPIC -c -o Scrt1_c.o ${CSUDIR}/crt1_c.c
Makefile.csu was imported from FreeBSD. This is the description of the problem
from FreeBSD:
MFC r205398: Do not create *.gmon files for PIE executables on i386.
Scrt1_c.o was accidentally compiled with -DGCRT (profiling), like gcrt1_c.o.
This problem is i386-specific, the other architectures are OK.
If you have problems with PIE executables such as samba and cups leaving
behind gmon files, rebuild them after installing this change.
PR: ports/143924
References:
http://www.freebsd.org/cgi/query-pr.cgi?pr=143924&cat=ports
http://svnweb.freebsd.org/base?view=revision&revision=207538
Updated by marino over 13 years ago
Thanks for the report and the fix!
http://leaf.dragonflybsd.org/mailarchive/commits/2011-05/msg00033.html