From bd789fa5909a64eede6dbf33798a41849e96722c Mon Sep 17 00:00:00 2001 From: k0kubun Date: Sun, 12 Aug 2018 14:42:25 +0000 Subject: [PATCH] mjit_worker.c: allow showing line number on addr2line.c, if --jit-save-temps is specified. I'm going to use the line number to lazily create program counter to improve the performance degraded in r64283. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- mjit_worker.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/mjit_worker.c b/mjit_worker.c index 5e73ba8a43..fb46df7828 100644 --- a/mjit_worker.c +++ b/mjit_worker.c @@ -254,11 +254,20 @@ static const char *const CC_COMMON_ARGS[] = { #define CC_PATH CC_COMMON_ARGS[0] static const char *const CC_DEBUG_ARGS[] = {MJIT_DEBUGFLAGS NULL}; -static const char *const CC_OPTIMIZE_ARGS[] = {MJIT_OPTFLAGS NULL}; +static const char *const CC_OPTIMIZE_ARGS[] = { + MJIT_OPTFLAGS +#ifdef USE_ELF /* at least -g1 is required to get line number on addr2line.c, and -g (-g2) is slow. */ + "-g1", +#endif + NULL +}; static const char *const CC_LDSHARED_ARGS[] = {MJIT_LDSHARED GCC_PIC_FLAGS NULL}; static const char *const CC_DLDFLAGS_ARGS[] = { MJIT_DLDFLAGS +#ifdef USE_ELF /* force disable compression to get line number on addr2line.c */ + "-Wl,--compress-debug-sections=none", +#endif #if defined __GNUC__ && !defined __clang__ "-nostartfiles", # if !defined(_WIN32) && !defined(__CYGWIN__)