Changeset 946b3cb in rtems


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, 5, 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.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • configure

    rcb16032 r946b3cb  
    27262726
    27272727
    2728 test "$ac_cv_prog_gcc" = "yes" && CC_CFLAGS_DEFAULT=-Wall
    2729 test "$ac_cv_prog_cc_g" = "yes" && CC_CFLAGS_DEBUG_V=-g
     2728if test "$ac_cv_prog_gcc" = "yes"; then
     2729  CC_CFLAGS_DEFAULT=-Wall
     2730  CC_CFLAGS_PROFILE_V=${CC_CFLAGS_PROFILE_V-"-pg"}
     2731  CC_LDFLAGS_PROFILE_V=${CC_LDFLAGS_PROFILE_V-$CC_CFLAGS_PROFILE_V}
     2732fi
     2733
     2734test "$ac_cv_prog_cc_g" = "yes" && CC_CFLAGS_DEBUG_V=${CC_CFLAGS_DEBUG_V-"-g"}
    27302735
    27312736for ac_func in strerror
    27322737do
    27332738echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
    2734 echo "configure:2735: checking for $ac_func" >&5
     2739echo "configure:2740: checking for $ac_func" >&5
    27352740if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
    27362741  echo $ac_n "(cached) $ac_c" 1>&6
    27372742else
    27382743  cat > conftest.$ac_ext <<EOF
    2739 #line 2740 "configure"
     2744#line 2745 "configure"
    27402745#include "confdefs.h"
    27412746/* System header to define __stub macros and hopefully few prototypes,
     
    27602765; return 0; }
    27612766EOF
    2762 if { (eval echo configure:2763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
     2767if { (eval echo configure:2768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    27632768  rm -rf conftest*
    27642769  eval "ac_cv_func_$ac_func=yes"
     
    27892794
    27902795echo $ac_n "checking whether $RTEMS_HOST supports System V semaphores""... $ac_c" 1>&6
    2791 echo "configure:2792: checking whether $RTEMS_HOST supports System V semaphores" >&5
     2796echo "configure:2797: checking whether $RTEMS_HOST supports System V semaphores" >&5
    27922797if eval "test \"`echo '$''{'rtems_cv_sysv_sem'+set}'`\" = set"; then
    27932798  echo $ac_n "(cached) $ac_c" 1>&6
     
    27982803else
    27992804  cat > conftest.$ac_ext <<EOF
    2800 #line 2801 "configure"
     2805#line 2806 "configure"
    28012806#include "confdefs.h"
    28022807
     
    28242829
    28252830EOF
    2826 if { (eval echo configure:2827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
     2831if { (eval echo configure:2832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
    28272832then
    28282833  rtems_cv_sysv_sem="yes"
     
    28472852
    28482853echo $ac_n "checking whether $RTEMS_HOST supports System V shared memory""... $ac_c" 1>&6
    2849 echo "configure:2850: checking whether $RTEMS_HOST supports System V shared memory" >&5
     2854echo "configure:2855: checking whether $RTEMS_HOST supports System V shared memory" >&5
    28502855if eval "test \"`echo '$''{'rtems_cv_sysv_shm'+set}'`\" = set"; then
    28512856  echo $ac_n "(cached) $ac_c" 1>&6
     
    28562861else
    28572862  cat > conftest.$ac_ext <<EOF
    2858 #line 2859 "configure"
     2863#line 2864 "configure"
    28592864#include "confdefs.h"
    28602865
     
    28722877
    28732878EOF
    2874 if { (eval echo configure:2875: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
     2879if { (eval echo configure:2880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
    28752880then
    28762881  rtems_cv_sysv_shm="yes"
     
    28952900
    28962901echo $ac_n "checking whether $RTEMS_HOST supports System V messages""... $ac_c" 1>&6
    2897 echo "configure:2898: checking whether $RTEMS_HOST supports System V messages" >&5
     2902echo "configure:2903: checking whether $RTEMS_HOST supports System V messages" >&5
    28982903if eval "test \"`echo '$''{'rtems_cv_sysv_msg'+set}'`\" = set"; then
    28992904  echo $ac_n "(cached) $ac_c" 1>&6
     
    29042909else
    29052910  cat > conftest.$ac_ext <<EOF
    2906 #line 2907 "configure"
     2911#line 2912 "configure"
    29072912#include "confdefs.h"
    29082913
     
    29202925
    29212926EOF
    2922 if { (eval echo configure:2923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
     2927if { (eval echo configure:2928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
    29232928then
    29242929  rtems_cv_sysv_msg="yes"
     
    29452950
    29462951echo $ac_n "checking for Makefile.in in c/src/exec/score/tools/$target_cpu""... $ac_c" 1>&6
    2947 echo "configure:2948: checking for Makefile.in in c/src/exec/score/tools/$target_cpu" >&5
     2952echo "configure:2953: checking for Makefile.in in c/src/exec/score/tools/$target_cpu" >&5
    29482953if test -d $srcdir/c/src/exec/score/tools/$target_cpu; then
    29492954  rtems_av_save_dir=`pwd`;
     
    29602965
    29612966echo $ac_n "checking for Makefile.in in c/src/exec/rtems""... $ac_c" 1>&6
    2962 echo "configure:2963: checking for Makefile.in in c/src/exec/rtems" >&5
     2967echo "configure:2968: checking for Makefile.in in c/src/exec/rtems" >&5
    29632968if test -d $srcdir/c/src/exec/rtems; then
    29642969  rtems_av_save_dir=`pwd`;
     
    29752980
    29762981echo $ac_n "checking for Makefile.in in c/src/exec/sapi""... $ac_c" 1>&6
    2977 echo "configure:2978: checking for Makefile.in in c/src/exec/sapi" >&5
     2982echo "configure:2983: checking for Makefile.in in c/src/exec/sapi" >&5
    29782983if test -d $srcdir/c/src/exec/sapi; then
    29792984  rtems_av_save_dir=`pwd`;
     
    29922997 
    29932998echo $ac_n "checking for Makefile.in in c/src/exec/posix""... $ac_c" 1>&6
    2994 echo "configure:2995: checking for Makefile.in in c/src/exec/posix" >&5
     2999echo "configure:3000: checking for Makefile.in in c/src/exec/posix" >&5
    29953000if test -d $srcdir/c/src/exec/posix; then
    29963001  rtems_av_save_dir=`pwd`;
     
    30143019  if test -z "$rtems_bsp"; then
    30153020    echo $ac_n "checking for bsps""... $ac_c" 1>&6
    3016 echo "configure:3017: checking for bsps" >&5
     3021echo "configure:3022: checking for bsps" >&5
    30173022    files=`ls $srcdir/c/src/lib/libbsp/$target_cpu`
    30183023    for file in $files; do
     
    30793084       
    30803085echo $ac_n "checking for Makefile.in in c/src/lib/libbsp/$bspcpudir$bspdir""... $ac_c" 1>&6
    3081 echo "configure:3082: checking for Makefile.in in c/src/lib/libbsp/$bspcpudir$bspdir" >&5
     3086echo "configure:3087: checking for Makefile.in in c/src/lib/libbsp/$bspcpudir$bspdir" >&5
    30823087if test -d $srcdir/c/src/lib/libbsp/$bspcpudir$bspdir; then
    30833088  rtems_av_save_dir=`pwd`;
     
    30943099       
    30953100echo $ac_n "checking for Makefile.in in c/src/lib/libbsp/${bspcpudir}shared""... $ac_c" 1>&6
    3096 echo "configure:3097: checking for Makefile.in in c/src/lib/libbsp/${bspcpudir}shared" >&5
     3101echo "configure:3102: checking for Makefile.in in c/src/lib/libbsp/${bspcpudir}shared" >&5
    30973102if test -d $srcdir/c/src/lib/libbsp/${bspcpudir}shared; then
    30983103  rtems_av_save_dir=`pwd`;
     
    31173122
    31183123echo $ac_n "checking for Makefile.in in c/src/lib/libcpu/$target_cpu""... $ac_c" 1>&6
    3119 echo "configure:3120: checking for Makefile.in in c/src/lib/libcpu/$target_cpu" >&5
     3124echo "configure:3125: checking for Makefile.in in c/src/lib/libcpu/$target_cpu" >&5
    31203125if test -d $srcdir/c/src/lib/libcpu/$target_cpu; then
    31213126  rtems_av_save_dir=`pwd`;
     
    31343139 
    31353140echo $ac_n "checking for Makefile.in in c/src/lib/start/$target_cpu""... $ac_c" 1>&6
    3136 echo "configure:3137: checking for Makefile.in in c/src/lib/start/$target_cpu" >&5
     3141echo "configure:3142: checking for Makefile.in in c/src/lib/start/$target_cpu" >&5
    31373142if test -d $srcdir/c/src/lib/start/$target_cpu; then
    31383143  rtems_av_save_dir=`pwd`;
     
    31663171# If the TCP/IP stack is enabled, then find all TCP/IP Makefiles
    31673172echo $ac_n "checking if networking is enabled? ""... $ac_c" 1>&6
    3168 echo "configure:3169: checking if networking is enabled? " >&5
     3173echo "configure:3174: checking if networking is enabled? " >&5
    31693174echo "$ac_t""$RTEMS_HAS_NETWORKING" 1>&6
    31703175if test "$RTEMS_HAS_NETWORKING" = "yes"; then
    31713176 
    31723177echo $ac_n "checking for Makefile.in in c/src/lib/libnetworking""... $ac_c" 1>&6
    3173 echo "configure:3174: checking for Makefile.in in c/src/lib/libnetworking" >&5
     3178echo "configure:3179: checking for Makefile.in in c/src/lib/libnetworking" >&5
    31743179if test -d $srcdir/c/src/lib/libnetworking; then
    31753180  rtems_av_save_dir=`pwd`;
     
    31933198# If the tests are enabled, then find all the test suite Makefiles
    31943199echo $ac_n "checking if the test suites are enabled? ""... $ac_c" 1>&6
    3195 echo "configure:3196: checking if the test suites are enabled? " >&5
     3200echo "configure:3201: checking if the test suites are enabled? " >&5
    31963201tests_enabled=yes
    31973202# Check whether --enable-tests or --disable-tests was given.
     
    32123217
    32133218echo $ac_n "checking for Makefile.in in c/src/tests/tools/$target_cpu""... $ac_c" 1>&6
    3214 echo "configure:3215: checking for Makefile.in in c/src/tests/tools/$target_cpu" >&5
     3219echo "configure:3220: checking for Makefile.in in c/src/tests/tools/$target_cpu" >&5
    32153220if test -d $srcdir/c/src/tests/tools/$target_cpu; then
    32163221  rtems_av_save_dir=`pwd`;
     
    32293234   
    32303235echo $ac_n "checking for Makefile.in in c/src/tests/libtests""... $ac_c" 1>&6
    3231 echo "configure:3232: checking for Makefile.in in c/src/tests/libtests" >&5
     3236echo "configure:3237: checking for Makefile.in in c/src/tests/libtests" >&5
    32323237if test -d $srcdir/c/src/tests/libtests; then
    32333238  rtems_av_save_dir=`pwd`;
     
    32443249   
    32453250echo $ac_n "checking for Makefile.in in c/src/tests/sptests""... $ac_c" 1>&6
    3246 echo "configure:3247: checking for Makefile.in in c/src/tests/sptests" >&5
     3251echo "configure:3252: checking for Makefile.in in c/src/tests/sptests" >&5
    32473252if test -d $srcdir/c/src/tests/sptests; then
    32483253  rtems_av_save_dir=`pwd`;
     
    32593264   
    32603265echo $ac_n "checking for Makefile.in in c/src/tests/tmtests""... $ac_c" 1>&6
    3261 echo "configure:3262: checking for Makefile.in in c/src/tests/tmtests" >&5
     3266echo "configure:3267: checking for Makefile.in in c/src/tests/tmtests" >&5
    32623267if test -d $srcdir/c/src/tests/tmtests; then
    32633268  rtems_av_save_dir=`pwd`;
     
    32743279   
    32753280echo $ac_n "checking for Makefile.in in c/src/tests/mptests""... $ac_c" 1>&6
    3276 echo "configure:3277: checking for Makefile.in in c/src/tests/mptests" >&5
     3281echo "configure:3282: checking for Makefile.in in c/src/tests/mptests" >&5
    32773282if test -d $srcdir/c/src/tests/mptests; then
    32783283  rtems_av_save_dir=`pwd`;
     
    32903295     
    32913296echo $ac_n "checking for Makefile.in in c/src/tests/psxtests""... $ac_c" 1>&6
    3292 echo "configure:3293: checking for Makefile.in in c/src/tests/psxtests" >&5
     3297echo "configure:3298: checking for Makefile.in in c/src/tests/psxtests" >&5
    32933298if test -d $srcdir/c/src/tests/psxtests; then
    32943299  rtems_av_save_dir=`pwd`;
     
    33083313# If the HWAPI is enabled, the find the HWAPI Makefiles
    33093314echo $ac_n "checking if the HWAPI is enabled? ""... $ac_c" 1>&6
    3310 echo "configure:3311: checking if the HWAPI is enabled? " >&5
     3315echo "configure:3316: checking if the HWAPI is enabled? " >&5
    33113316# Check whether --enable-hwapi or --disable-hwapi was given.
    33123317if test "${enable_hwapi+set}" = set; then
     
    33193324           
    33203325echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/analog""... $ac_c" 1>&6
    3321 echo "configure:3322: checking for Makefile.in in c/src/lib/libhwapi/analog" >&5
     3326echo "configure:3327: checking for Makefile.in in c/src/lib/libhwapi/analog" >&5
    33223327if test -d $srcdir/c/src/lib/libhwapi/analog; then
    33233328  rtems_av_save_dir=`pwd`;
     
    33343339           
    33353340echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/discrete""... $ac_c" 1>&6
    3336 echo "configure:3337: checking for Makefile.in in c/src/lib/libhwapi/discrete" >&5
     3341echo "configure:3342: checking for Makefile.in in c/src/lib/libhwapi/discrete" >&5
    33373342if test -d $srcdir/c/src/lib/libhwapi/discrete; then
    33383343  rtems_av_save_dir=`pwd`;
     
    33493354           
    33503355echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/drivers""... $ac_c" 1>&6
    3351 echo "configure:3352: checking for Makefile.in in c/src/lib/libhwapi/drivers" >&5
     3356echo "configure:3357: checking for Makefile.in in c/src/lib/libhwapi/drivers" >&5
    33523357if test -d $srcdir/c/src/lib/libhwapi/drivers; then
    33533358  rtems_av_save_dir=`pwd`;
     
    33643369           
    33653370echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/non_volatile_memory""... $ac_c" 1>&6
    3366 echo "configure:3367: checking for Makefile.in in c/src/lib/libhwapi/non_volatile_memory" >&5
     3371echo "configure:3372: checking for Makefile.in in c/src/lib/libhwapi/non_volatile_memory" >&5
    33673372if test -d $srcdir/c/src/lib/libhwapi/non_volatile_memory; then
    33683373  rtems_av_save_dir=`pwd`;
     
    33793384           
    33803385echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/serial""... $ac_c" 1>&6
    3381 echo "configure:3382: checking for Makefile.in in c/src/lib/libhwapi/serial" >&5
     3386echo "configure:3387: checking for Makefile.in in c/src/lib/libhwapi/serial" >&5
    33823387if test -d $srcdir/c/src/lib/libhwapi/serial; then
    33833388  rtems_av_save_dir=`pwd`;
     
    33943399           
    33953400echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/support""... $ac_c" 1>&6
    3396 echo "configure:3397: checking for Makefile.in in c/src/lib/libhwapi/support" >&5
     3401echo "configure:3402: checking for Makefile.in in c/src/lib/libhwapi/support" >&5
    33973402if test -d $srcdir/c/src/lib/libhwapi/support; then
    33983403  rtems_av_save_dir=`pwd`;
     
    34093414           
    34103415echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/wrapup""... $ac_c" 1>&6
    3411 echo "configure:3412: checking for Makefile.in in c/src/lib/libhwapi/wrapup" >&5
     3416echo "configure:3417: checking for Makefile.in in c/src/lib/libhwapi/wrapup" >&5
    34123417if test -d $srcdir/c/src/lib/libhwapi/wrapup; then
    34133418  rtems_av_save_dir=`pwd`;
     
    34543459
    34553460
     3461
     3462
    34563463# pick up all the Makefiles in required parts of the tree
    34573464
    34583465echo $ac_n "checking for Makefile.in in c/build-tools""... $ac_c" 1>&6
    3459 echo "configure:3460: checking for Makefile.in in c/build-tools" >&5
     3466echo "configure:3467: checking for Makefile.in in c/build-tools" >&5
    34603467if test -d $srcdir/c/build-tools; then
    34613468  rtems_av_save_dir=`pwd`;
     
    34723479
    34733480echo $ac_n "checking for Makefile.in in make""... $ac_c" 1>&6
    3474 echo "configure:3475: checking for Makefile.in in make" >&5
     3481echo "configure:3482: checking for Makefile.in in make" >&5
    34753482if test -d $srcdir/make; then
    34763483  rtems_av_save_dir=`pwd`;
     
    34873494
    34883495echo $ac_n "checking for Makefile.in in c/src/lib/libmisc""... $ac_c" 1>&6
    3489 echo "configure:3490: checking for Makefile.in in c/src/lib/libmisc" >&5
     3496echo "configure:3497: checking for Makefile.in in c/src/lib/libmisc" >&5
    34903497if test -d $srcdir/c/src/lib/libmisc; then
    34913498  rtems_av_save_dir=`pwd`;
     
    35023509
    35033510echo $ac_n "checking for Makefile.in in c/src/tests/samples""... $ac_c" 1>&6
    3504 echo "configure:3505: checking for Makefile.in in c/src/tests/samples" >&5
     3511echo "configure:3512: checking for Makefile.in in c/src/tests/samples" >&5
    35053512if test -d $srcdir/c/src/tests/samples; then
    35063513  rtems_av_save_dir=`pwd`;
     
    37453752s%@CC_CFLAGS_DEFAULT@%$CC_CFLAGS_DEFAULT%g
    37463753s%@CC_CFLAGS_DEBUG_V@%$CC_CFLAGS_DEBUG_V%g
     3754s%@CC_CFLAGS_PROFILE_V@%$CC_CFLAGS_PROFILE_V%g
     3755s%@CC_LDFLAGS_PROFILE_V@%$CC_LDFLAGS_PROFILE_V%g
    37473756
    37483757CEOF
  • configure.in

    rcb16032 r946b3cb  
    245245
    246246dnl FIXME: This is a kludge
     247dnl Set flags to settings all gcc variants are assumed to accept.
     248if test "$ac_cv_prog_gcc" = "yes"; then
    247249dnl Add -Wall if using gcc as host compiler
    248 test "$ac_cv_prog_gcc" = "yes" && CC_CFLAGS_DEFAULT=-Wall
     250  CC_CFLAGS_DEFAULT=-Wall
     251dnl Add -pg to profile flags, unless specified in the environment
     252  CC_CFLAGS_PROFILE_V=${CC_CFLAGS_PROFILE_V-"-pg"}
     253dnl propagate cflags to ldflags, unless specified in the environment
     254  CC_LDFLAGS_PROFILE_V=${CC_LDFLAGS_PROFILE_V-$CC_CFLAGS_PROFILE_V}
     255fi
     256
    249257dnl Add -g if the host compiler accepts -g, assume -g means debugging
    250 test "$ac_cv_prog_cc_g" = "yes" && CC_CFLAGS_DEBUG_V=-g
     258test "$ac_cv_prog_cc_g" = "yes" && CC_CFLAGS_DEBUG_V=${CC_CFLAGS_DEBUG_V-"-g"}
    251259
    252260dnl check for host library functions
     
    461469AC_SUBST(CC_CFLAGS_DEFAULT)
    462470AC_SUBST(CC_CFLAGS_DEBUG_V)
     471AC_SUBST(CC_CFLAGS_PROFILE_V)
     472AC_SUBST(CC_LDFLAGS_PROFILE_V)
    463473
    464474# pick up all the Makefiles in required parts of the tree
  • 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.