[asterisk-bugs] [JIRA] (ASTERISK-25289) Build System does not respect CFLAGS and CXXFLAGS when building menuselect
abelbeck (JIRA)
noreply at issues.asterisk.org
Tue Sep 6 09:32:01 CDT 2016
[ https://issues.asterisk.org/jira/browse/ASTERISK-25289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=232159#comment-232159 ]
abelbeck commented on ASTERISK-25289:
-------------------------------------
Alexander, we use Buildroot to cross-compile, so a lot of CFLAGS are set.
Yes we use menuselect/menuselect, here is an example from Asterisk 11.23.0 without this fix.
{noformat}
(cd /home/dev/astlinux/1.0/output/build/asterisk-11.23.0; \
menuselect/menuselect --enable res_pktccops menuselect.makeopts; \
menuselect/menuselect --disable CORE-SOUNDS-EN-GSM --disable MOH-OPSOUND-WAV menuselect.makeopts; \
menuselect/menuselect --disable BUILD_NATIVE menuselect.makeopts; \
)
Unknown value '' found in build_tools/menuselect-deps for NATIVE_ARCH
Unknown value '' found in build_tools/menuselect-deps for HAVE_LEAK_SANITIZER
Unknown value '' found in build_tools/menuselect-deps for HAVE_UNDEFINED_SANITIZER
Unknown value '' found in build_tools/menuselect-deps for NATIVE_ARCH
Unknown value '' found in build_tools/menuselect-deps for HAVE_LEAK_SANITIZER
Unknown value '' found in build_tools/menuselect-deps for HAVE_UNDEFINED_SANITIZER
Unknown value '' found in build_tools/menuselect-deps for NATIVE_ARCH
Unknown value '' found in build_tools/menuselect-deps for HAVE_LEAK_SANITIZER
Unknown value '' found in build_tools/menuselect-deps for HAVE_UNDEFINED_SANITIZER
{noformat}
While all the error messages are annoying, each menuselect/menuselect returns with "0" and works as expected.
For cross-compiling AST_NATIVE_ARCH=0 would seem like the proper choice to be generated.
The NATIVE_ARCH feature was reviewed here: https://reviewboard.asterisk.org/r/1852/
I'm somewhat puzzled why AST_NATIVE_ARCH= (undefined) was introduced, it would seem only AST_NATIVE_ARCH=0 and AST_NATIVE_ARCH=1 would be needed.
> Build System does not respect CFLAGS and CXXFLAGS when building menuselect
> --------------------------------------------------------------------------
>
> Key: ASTERISK-25289
> URL: https://issues.asterisk.org/jira/browse/ASTERISK-25289
> Project: Asterisk
> Issue Type: Bug
> Security Level: None
> Components: Core/BuildSystem
> Affects Versions: 11.22.0, 13.9.1
> Environment: Fedora 22, x86_64; but any distro with a compiler with sanitizers will do (excpet maybe Clang, since it reject's the use of trampolines that Asterisk uses).
> Reporter: Jeffrey Walton
> Assignee: Alexander Traud
> Target Release: 13.11.0, 14.0.0
>
> Attachments: cflag_alternative_A.patch, cflag_alternative_B.patch, config.log
>
>
> GCC added sanitizers at 4.8. I'm attempting to build Asterisk with the UBsan (undefined behavior) and Asan (address) sanitizers enabled. UBsan is enabled with `-fsanitize=undefined`, and Asan is enabled with `-fsanitize=address`. (UBasan and Asan are mutually exclusive, so we repeat the steps below twice).
> localhost asterisk-13.4.0]$ export CFLAGS=-fsanitize=undefined
> localhost asterisk-13.4.0]$ export CXXFLAGS=-fsanitize=undefined
> localhost asterisk-13.4.0]$ ./configure
> ...
> Looking at the config.log, it appears the CFLAGS and CXXFLAGS were tested and accepted. Then:
> configure: Package configured for:
> configure: OS type : linux-gnu
> configure: Host CPU : x86_64
> configure: build-cpu:vendor:os: x86_64 : unknown : linux-gnu :
> configure: host-cpu:vendor:os: x86_64 : unknown : linux-gnu :
> localhost asterisk-13.4.0]$ make
> CC="cc" CXX="g++" LD="" AR="" RANLIB="" CFLAGS="" LDFLAGS="" make -C menuselect CONFIGURE_SILENT="--silent" makeopts
> make[1]: Entering directory '/home/jwalton/Desktop/asterisk-13.4.0/menuselect'
> make[1]: 'makeopts' is up to date.
> make[1]: Leaving directory '/home/jwalton/Desktop/asterisk-13.4.0/menuselect'
> CC="cc" CXX="g++" LD="" AR="" RANLIB="" CFLAGS="" LDFLAGS="" make -C menuselect CONFIGURE_SILENT="--silent" menuselect
> make[1]: Entering directory '/home/jwalton/Desktop/asterisk-13.4.0/menuselect'
> gcc -g -D_GNU_SOURCE -Wall -I/usr/include/libxml2 -c -o menuselect.o menuselect.c
> gcc -g -D_GNU_SOURCE -Wall -c -o strcompat.o strcompat.c
> gcc -g -D_GNU_SOURCE -Wall -c -o menuselect_stub.o menuselect_stub.c
> gcc -o menuselect menuselect.o strcompat.o menuselect_stub.o -lxml2 -lz -lm -ldl
> make[1]: Leaving directory '/home/jwalton/Desktop/asterisk-13.4.0/menuselect'
> Generating input for menuselect ...
> menuselect/menuselect --check-deps menuselect.makeopts
> Unknown value '' found in build_tools/menuselect-deps for NATIVE_ARCH
> ***********************************************************
> The existing menuselect.makeopts file did not specify
> that 'BUILD_NATIVE' should not be included. However, either some
> dependencies for this module were not found or a
> conflict exists.
>
> Either run 'make menuselect' or remove the existing
> menuselect.makeopts file to resolve this issue.
> ***********************************************************
> Makefile:344: recipe for target 'menuselect.makeopts' failed
> make: *** [menuselect.makeopts] Error 255
--
This message was sent by Atlassian JIRA
(v6.2#6252)
More information about the asterisk-bugs
mailing list