Autoconf clobbers CFLAGS that we set by --enable-debug, turning -O2 level of optimization, that is not desired in the debug build.
--enable-debug
Here's the example of ./configure --enable-debug and --enable-asan:
./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
-g3 -DDEBUG -DMCC_DEBUG -O0
-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
Metadata Update from @vashirov: - Issue assigned to vashirov
https://pagure.io/389-ds-base/pull-request/49686
Metadata Update from @mreynolds: - Custom field reviewstatus adjusted to ack (was: None)
Thanks Mark! Fixed in 68ecbff.
Metadata Update from @vashirov: - Issue close_status updated to: fixed - Issue status updated to: Closed (was: Open)
Reopening to incorporate feedback from @lslebodn.
Metadata Update from @vashirov: - Issue status updated to: Open (was: Closed)
https://pagure.io/389-ds-base/pull-request/49690
Metadata Update from @vashirov: - Custom field reviewstatus adjusted to review (was: ack)
commit 8330887
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)
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.
subscribe
Thank you for understanding. We apologize for all inconvenience.
Metadata Update from @spichugi: - Issue close_status updated to: wontfix (was: fixed)
Login to comment on this ticket.