Project

General

Profile

Actions

Bug #2063

closed

Position Independent Executables (PIE) create unwanted gmon files

Added by mroland almost 13 years ago. Updated almost 13 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

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

Actions #1

Updated by marino almost 13 years ago

I'll take it.

Actions

Also available in: Atom PDF