help-bash
[Top][All Lists]
Advanced

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

[Help-bash] How to build bash with additional compiler flags?


From: Peng Yu
Subject: [Help-bash] How to build bash with additional compiler flags?
Date: Wed, 23 Jan 2019 17:26:09 -0600

Hi,

I'd like to add the following compiler flags. Normally they should be
via the following standard flags

CFLAGS -finstrument-functions
LDFLAGS -Lsomedir_for_trace -Wl,-no_pie
LDLIBS -ltrace

Meanwhile, I want to keep -g but disable -O2.

However, bash does not seem to use the GNU Make variables in the
standard way. For example, it does not use LDLIBS. I tried with LIBS,
but it will not compile. I also played with CFLAGS_FOR_BUILD and
LDFLAGS_FOR_BUILD, but I can not get it to work.

$ ./configure CFLAGS=-g\ -finstrument-functions LDFLAGS=-Wl\,-no_pie\
-Lsomedir_for_trace LIBS=-ltrace
$ make
...
gcc -DPROGRAM='"bash"' -DCONF_HOSTTYPE='"x86_64"'
-DCONF_OSTYPE='"darwin17.7.0"'
-DCONF_MACHTYPE='"x86_64-apple-darwin17.7.0"' -DCONF_VENDOR='"apple"'
-DLOCALEDIR='"/usr/local/share/locale"' -DPACKAGE='"bash"' -DSHELL
-DHAVE_CONFIG_H -DMACOSX   -I.  -I../../../extract/bash-5.0
-I../../../extract/bash-5.0/include -I../../../extract/bash-5.0/lib
-I../../../extract/bash-5.0/lib/intl
-I/Users/pengy/homebake/work/bash/build/Darwin/bash-5.0-hcBSAERFcp/lib/intl
 -g -finstrument-functions   -Wl,-no_pie
-L/Users/pengy/linux/bin/wrappercomposite/src/xplat/llvmxplat/src/mkvar/bin/Darwin
 -g -finstrument-functions -Wno-parentheses -Wno-format-security    -g
-finstrument-functions  -o mksyntax
../../../extract/bash-5.0/mksyntax.c
Undefined symbols for architecture x86_64:
  "___cyg_profile_func_enter", referenced from:
      _main in mksyntax-2c621c.o
      _dump_lsyntax in mksyntax-2c621c.o
      _usage in mksyntax-2c621c.o
      _load_lsyntax in mksyntax-2c621c.o
      _addcstr in mksyntax-2c621c.o
      _addcchar in mksyntax-2c621c.o
      _getcstr in mksyntax-2c621c.o
      ...
  "___cyg_profile_func_exit", referenced from:
      _dump_lsyntax in mksyntax-2c621c.o
      _load_lsyntax in mksyntax-2c621c.o
      _addcstr in mksyntax-2c621c.o
      _addcchar in mksyntax-2c621c.o
      _getcstr in mksyntax-2c621c.o
      _cdesc in mksyntax-2c621c.o
      _addblanks in mksyntax-2c621c.o
      ...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [mksyntax] Error 1


Does anybody know how to add these options?

Thanks.

-- 
Regards,
Peng



reply via email to

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