Commit 271f61fb by David O'Brien Committed by David O'Brien

g++spec.c: Use profiled libstdc++ and libm with -p/-pg.

2002-04-23  David O'Brien  <obrien@FreeBSD.org>
	* g++spec.c: Use profiled libstdc++ and libm with -p/-pg.
	* config/freebsd.h (MATH_LIBRARY_PROFILE): Use the _p verions of
	these libraries.

Approved by:  Richard Henderson <rth@redhat.com>
              Message-ID: <20020422223253.A32678@redhat.com>

From-SVN: r52667
parent bdabbc80
2002-04-23 David O'Brien <obrien@FreeBSD.org> 2002-04-23 David O'Brien <obrien@FreeBSD.org>
* g++spec.c: Use profiled libstdc++ and libm with -p/-pg.
* config/freebsd.h (MATH_LIBRARY_PROFILE): Use the _p verions of
these libraries.
2002-04-23 David O'Brien <obrien@FreeBSD.org>
* config/freebsd.h(OBJECT_FORMAT_ELF): Define. * config/freebsd.h(OBJECT_FORMAT_ELF): Define.
Tue Apr 23 14:24:25 CEST 2002 Jan Hubicka <jh@suse.cz> Tue Apr 23 14:24:25 CEST 2002 Jan Hubicka <jh@suse.cz>
......
...@@ -79,6 +79,8 @@ Boston, MA 02111-1307, USA. */ ...@@ -79,6 +79,8 @@ Boston, MA 02111-1307, USA. */
#undef WCHAR_UNSIGNED #undef WCHAR_UNSIGNED
#define WCHAR_UNSIGNED 0 #define WCHAR_UNSIGNED 0
#define MATH_LIBRARY_PROFILE "-lm_p"
/* Code generation parameters. */ /* Code generation parameters. */
/* Use periods rather than dollar signs in special g++ assembler names. /* Use periods rather than dollar signs in special g++ assembler names.
......
...@@ -32,10 +32,16 @@ Boston, MA 02111-1307, USA. */ ...@@ -32,10 +32,16 @@ Boston, MA 02111-1307, USA. */
#ifndef MATH_LIBRARY #ifndef MATH_LIBRARY
#define MATH_LIBRARY "-lm" #define MATH_LIBRARY "-lm"
#endif #endif
#ifndef MATH_LIBRARY_PROFILE
#define MATH_LIBRARY_PROFILE "-lm"
#endif
#ifndef LIBSTDCXX #ifndef LIBSTDCXX
#define LIBSTDCXX "-lstdc++" #define LIBSTDCXX "-lstdc++"
#endif #endif
#ifndef LIBSTDCXX_PROFILE
#define LIBSTDCXX_PROFILE "-lstdc++"
#endif
void void
lang_specific_driver (in_argc, in_argv, in_added_libraries) lang_specific_driver (in_argc, in_argv, in_added_libraries)
...@@ -45,6 +51,9 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries) ...@@ -45,6 +51,9 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
{ {
int i, j; int i, j;
/* If non-zero, the user gave us the `-p' or `-pg' flag. */
int saw_profile_flag = 0;
/* If non-zero, the user gave us the `-v' flag. */ /* If non-zero, the user gave us the `-v' flag. */
int saw_verbose_flag = 0; int saw_verbose_flag = 0;
...@@ -137,6 +146,8 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries) ...@@ -137,6 +146,8 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
} }
else if (strcmp (argv[i], "-lc") == 0) else if (strcmp (argv[i], "-lc") == 0)
args[i] |= WITHLIBC; args[i] |= WITHLIBC;
else if (strcmp (argv[i], "-pg") == 0 || strcmp (argv[i], "-p") == 0)
saw_profile_flag++;
else if (strcmp (argv[i], "-v") == 0) else if (strcmp (argv[i], "-v") == 0)
{ {
saw_verbose_flag = 1; saw_verbose_flag = 1;
...@@ -259,14 +270,14 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries) ...@@ -259,14 +270,14 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
/* Add `-lstdc++' if we haven't already done so. */ /* Add `-lstdc++' if we haven't already done so. */
if (library) if (library)
{ {
arglist[j++] = LIBSTDCXX; arglist[j++] = saw_profile_flag ? LIBSTDCXX_PROFILE : LIBSTDCXX;
added_libraries++; added_libraries++;
} }
if (saw_math) if (saw_math)
arglist[j++] = saw_math; arglist[j++] = saw_math;
else if (library && need_math) else if (library && need_math)
{ {
arglist[j++] = MATH_LIBRARY; arglist[j++] = saw_profile_flag ? MATH_LIBRARY_PROFILE : MATH_LIBRARY;
added_libraries++; added_libraries++;
} }
if (saw_libc) if (saw_libc)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment