#49684 AC_PROG_CC clobbers CFLAGS set by --enable-debug
Closed: wontfix 5 years ago Opened 5 years ago by vashirov.

Issue Description

Autoconf clobbers CFLAGS that we set by --enable-debug, turning -O2 level of optimization, that is not desired in the debug build.

Here's the example of ./configure --enable-debug and --enable-asan:

/bin/sh ./libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.  -g3 -DDEBUG -DMCC_DEBUG -O0 -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fsanitize=address -fno-omit-frame-pointer   -DBUILD_NUM=\"2018.134.1224\" -DVENDOR="\"389 Project\"" -DBRAND="\"389\"" -DCAPBRAND="\"389\"" -UPACKAGE_VERSION -UPACKAGE_TARNAME -UPACKAGE_STRING -UPACKAGE_BUGREPORT -I./ldap/include -I./ldap/servers/slapd -I./include -I. -I./src/nunc-stans/include/ -DLOCALSTATEDIR="\"/var\"" -DSYSCONFDIR="\"/etc\"" -DLIBDIR="\"/usr/lib64\"" -DBINDIR="\"/usr/bin\"" -DDATADIR="\"/usr/share\"" -DDOCDIR="\"/usr/share/doc/389-ds-base\"" -DSBINDIR="\"/usr/sbin\"" -DPLUGINDIR="\"/usr/lib64/dirsrv/plugins\"" -DTEMPLATEDIR="\"/usr/share/dirsrv/data\"" -DSYSTEMSCHEMADIR="\"/usr/share/dirsrv/schema\"" -DWITH_SYSTEMD -I./src/nunc-stans/include/ -I/usr/include  -I/usr/include/nss3 -I/usr/include/nspr4   -I/usr/include/sasl -I/usr/include/libdb -I/usr/include  -I/usr/include -I./src/libsds/include/ -I./src/libsds/external/ -I/usr/include/nspr4    -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -mcet -fcf-protection -c -o ldap/servers/slapd/libslapd_la-entry.lo `test -f 'ldap/servers/slapd/entry.c' || echo './'`ldap/servers/slapd/entry.c

Notice that we have -g3 -DDEBUG -DMCC_DEBUG -O0 in the beginning that later is overridden by -O2 -g


From the manual: https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/C-Compiler.html#C-Compiler

If using the GNU C compiler, set shell variable GCC to β€˜yes’. If output variable CFLAGS was not already set, set it to -g -O2 for the GNU C compiler (-O2 on systems where GCC does not accept -g), or -g for other compilers. If your package does not like this default, then it is acceptable to insert the line β€˜: ${CFLAGS=""}’ after AC_INIT and before AC_PROG_CC to select an empty default instead.

Metadata Update from @vashirov:
- Custom field component adjusted to None
- Custom field origin adjusted to None
- Custom field reviewstatus adjusted to None
- Custom field type adjusted to None
- Custom field version adjusted to None

5 years ago

Metadata Update from @vashirov:
- Issue assigned to vashirov

5 years ago

Metadata Update from @mreynolds:
- Custom field reviewstatus adjusted to ack (was: None)

5 years ago

Metadata Update from @vashirov:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

5 years ago

Reopening to incorporate feedback from @lslebodn.

Metadata Update from @vashirov:
- Issue status updated to: Open (was: Closed)

5 years ago

Metadata Update from @vashirov:
- Custom field reviewstatus adjusted to review (was: ack)

5 years ago

Metadata Update from @vashirov:
- Custom field reviewstatus adjusted to ack (was: review)
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

5 years ago

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/389ds/389-ds-base/issues/2743

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Metadata Update from @spichugi:
- Issue close_status updated to: wontfix (was: fixed)

3 years ago

Login to comment on this ticket.

Metadata