summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1998-10-14 19:42:45 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1998-10-14 19:42:45 +0000
commit946b3cb0cf91da6753b6a6e0f60b91d84fcdf097 (patch)
treec67fa01270f5c4db355ab291330c795f4962d8e0 /configure.in
parentcb160321feb5df88ba478f13f527619908e037c5 (diff)
downloadrtems-946b3cb0cf91da6753b6a6e0f60b91d84fcdf097.tar.bz2
Patch from Ralf Corsepius <corsepiu@faw.uni-ulm.de>:
2. "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.
Diffstat (limited to '')
-rw-r--r--configure.in14
1 files changed, 12 insertions, 2 deletions
diff --git a/configure.in b/configure.in
index acc2409357..2de743f3aa 100644
--- a/configure.in
+++ b/configure.in
@@ -244,10 +244,18 @@ esac
AC_SUBST(GCCSED)
dnl FIXME: This is a kludge
+dnl Set flags to settings all gcc variants are assumed to accept.
+if test "$ac_cv_prog_gcc" = "yes"; then
dnl Add -Wall if using gcc as host compiler
-test "$ac_cv_prog_gcc" = "yes" && CC_CFLAGS_DEFAULT=-Wall
+ CC_CFLAGS_DEFAULT=-Wall
+dnl Add -pg to profile flags, unless specified in the environment
+ CC_CFLAGS_PROFILE_V=${CC_CFLAGS_PROFILE_V-"-pg"}
+dnl propagate cflags to ldflags, unless specified in the environment
+ CC_LDFLAGS_PROFILE_V=${CC_LDFLAGS_PROFILE_V-$CC_CFLAGS_PROFILE_V}
+fi
+
dnl Add -g if the host compiler accepts -g, assume -g means debugging
-test "$ac_cv_prog_cc_g" = "yes" && CC_CFLAGS_DEBUG_V=-g
+test "$ac_cv_prog_cc_g" = "yes" && CC_CFLAGS_DEBUG_V=${CC_CFLAGS_DEBUG_V-"-g"}
dnl check for host library functions
dnl NOTE: must be called after AC_PROG_CC
@@ -460,6 +468,8 @@ AC_SUBST(PROJECT_ROOT)
AC_SUBST(program_prefix)
AC_SUBST(CC_CFLAGS_DEFAULT)
AC_SUBST(CC_CFLAGS_DEBUG_V)
+AC_SUBST(CC_CFLAGS_PROFILE_V)
+AC_SUBST(CC_LDFLAGS_PROFILE_V)
# pick up all the Makefiles in required parts of the tree
RTEMS_CHECK_MAKEFILE(c/build-tools)