Changeset 946b3cb in rtems for make/compilers


Ignore:
Timestamp:
Oct 14, 1998, 7:42:45 PM (22 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
11cfb6f
Parents:
cb16032
Message:

Patch from Ralf Corsepius <corsepiu@…>:

  1. "make profile" doesn't work. It aborts when building host-tools

for embedded targets. I didn't yet have enough time to fix this
problem. AFAIS this problem is related to handling of
LDFLAGS_PROFILE[|_V] in gcc.cfg.in. For host applications, we use
gcc for linking host applications, too. With profiling enabled
CFLAGS_PROFILE_V contains -pg and is used to compile, but
LDFLAGS_PROFILE_V is empty, hence -pg will not be passed to the
linker causing gcc to fail to link, because it can't resolve some
symbols introduced by compiling with -pg.

I am not sure if I can provide a patch for this - Ether it is trivial
to fix or requires basic work on host configuration ;-

Fixing this one was trivial - But hard to trace.

LDFLAGS_PROFILE_V needs to contain the same flags as CFLAGS_PROFILE_V,
if gcc is used for linking (What else should have been expected ?,
:-). The same problem was present for *_DEBUG_V, but apparently wasn't
noticed by anybody, because things didn't break, but were silently
ignored.

I fixed these problems by setting these flags in configure.in whenever
gcc is reported to be the host-compiler. For non-gcc host compilers
"make debug" and "make profile" now becomes the same as an ordinary
"make". This is a hack and addressing this problen could be more
sophisticated, but I don't think it gives much sense to support
compile variants for any host program (Who will ever try to
profile/debug host tools?). Therefore I don't think it's useful
to invest more effort into this problem.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • make/compilers/gcc.cfg.in

    rcb16032 r946b3cb  
    5555
    5656# profile flag; use gprof(1)
    57 CFLAGS_PROFILE_V=-pg
     57CFLAGS_PROFILE_V=@CC_CFLAGS_PROFILE_V@
    5858
    5959# default is to optimize
     
    9292
    9393# ld flags for profiling, debugging
    94 LDFLAGS_PROFILE_V =
     94LDFLAGS_PROFILE_V = @CC_LDFLAGS_PROFILE_V@
    9595LDFLAGS_DEBUG_V =
    9696
Note: See TracChangeset for help on using the changeset viewer.