bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gprofng/29479] Collection fails when built without java support: sy


From: slyich at gmail dot com
Subject: [Bug gprofng/29479] Collection fails when built without java support: symbol lookup error: ...-binutils-2.39/bin/../lib/gprofng/libgp-collector.so: undefined symbol: __collector_jprofile_start_attach
Date: Fri, 12 Aug 2022 21:59:17 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=29479

--- Comment #1 from Sergei Trofimovich <slyich at gmail dot com> ---
So far I worked it around locally by removing java-specific code in
libcollector:

--- a/gprofng/libcollector/collector.c
+++ b/gprofng/libcollector/collector.c
@@ -912,9 +912,11 @@ __collector_open_experiment (const char *exp, const char
*params, sp_origin_t or
   /* init tsd for unwind, called right after __collector_tsd_allocate()*/
   __collector_ext_unwind_key_init (1, NULL);

+#if defined(GPROFNG_JAVA_PROFILING)
   /* start java attach if suitable */
   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
     __collector_jprofile_start_attach ();
+#endif
   start_sec_time = CALL_UTIL (time)(NULL);
   __collector_start_time = collector_interface.getHiResTime ();
   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
--- a/gprofng/libcollector/unwind.c
+++ b/gprofng/libcollector/unwind.c
@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void
*arg)
   int size = max_frame_size;

 #define MIN(a,b) ((a)<(b)?(a):(b))
+#if defined(GPROFNG_JAVA_PROFILING)
   /* get Java info */
   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded &&
context && !pseudo_context)
     {
@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void
*arg)
          size -= sz;
        }
     }
+#endif

   /* get native stack */
   if (context)

Is it a reasonable approach? Or should jprofile.c unconditionally define those
functions? Say, with a possible no-op when `javac` is not available. What would
be your preference?

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]