Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: yopito on April 03, 2020, 08:29:58 am

Title: [20.03] crossbuild for aarch64 fails because of asm('int3') usage
Post by: yopito on April 03, 2020, 08:29:58 am
hello,

while trying to package C::B 20.03 for VoidLinux distribution (https://voidlinux.org), (cross)build for aarch64 target CPU architecture fails (see output below).

I'm surprised that asm() is used "directly" in code for a not so low-level system software.

Any clue on how to fix it ?

Thanks - Pierre

output of build for aarch64:

Quote
...
arch=armv8-a   -I/usr/aarch64-linux-musl/usr/include -Winvalid-pch -fPIC -fexceptions -MT drags
crollcfg.lo -MD -MP -MF $depbase.Tpo -c -o dragscrollcfg.lo dragscrollcfg.cpp &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  aarch64-linux-musl-c++ -DHAVE_CONFIG_H -I. -I../../../../src/include -I/usr/
aarch64-linux-musl/usr/lib/wx/include/gtk3-unicode-3.0 -I/usr/aarch64-linux-musl/usr/include/wx
-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -I../../../../src/include -I../..
/../../src/src -I../../../../src/sdk/wxscintilla/include -DCB_AUTOCONF -DCB_PRECOMP -DPIC -fsta
ck-clash-protection -D_FORTIFY_SOURCE=2 -O2 -pipe -march=armv8-a -I/usr/aarch64-linux-musl/usr/include -Winvalid-pch -fPIC -fexceptions -MT dragscrollcfg.lo -MD -MP -MF .deps/dragscrollcfg.Tpo -c dragscrollcfg.cpp  -fPIC -DPIC -o .libs/dragscrollcfg.o
{standard input}: Assembler messages:
{standard input}:845: Error: unknown mnemonic `int3' -- `int3'
make[4]: *** [Makefile:596: dragscrollcfg.lo] Error 1
make[4]: Leaving directory '/builddir/codeblocks-20.03/src/plugins/contrib/dragscroll'
make[3]: *** [Makefile:638: all-recursive] Error 1
make[3]: Leaving directory '/builddir/codeblocks-20.03/src/plugins/contrib'
make[2]: *** [Makefile:534: all-recursive] Error 1

asm() usage:

Code
codeblocks-20.03 $ grep -r " asm(" 

src/plugins/contrib/dragscroll/dragscrollcfg.h:        virtual void InitDialog(){ asm("int3");} /*trap*/
src/plugins/contrib/BrowseTracker/Version.h: #define TRAP asm("int3")
src/plugins/contrib/BrowseTracker/BrowseMarks.cpp:    if (not eb) asm("int3"); /*trap*/
src/plugins/contrib/BrowseTracker/BrowseMarks.cpp:    if (not eb) asm("int3"); /*trap*/
src/plugins/contrib/BrowseTracker/Version.cpp://         72) guard all asm(int3) with defined(LOGGING)
src/plugins/contrib/BrowseTracker/ProjectData.cpp:    if (not pcbProject) asm("int3"); /*trap*/;
src/plugins/contrib/BrowseTracker/ProjectData.cpp:        if(not eb) asm("int3"); /*trap*/
src/plugins/contrib/ThreadSearch/logging.h: #define TRAP asm("int3")
src/plugins/contrib/MouseSap/MouseSap.h: #define TRAP asm("int3")
src/plugins/contrib/keybinder/debugging.h: #define TRAP asm("int3")
src/plugins/contrib/codesnippets/version.h: #define TRAP asm("int3")

ChangeLog:svn4896:  BrowseTracker - guard all debugging asm(int3) with
Title: Re: [20.03] crossbuild for aarch64 fails because of asm('int3') usage
Post by: MortenMacFly on April 03, 2020, 08:31:23 am
Any clue on how to fix it ?
You are not the first one reporting this. We didn't see it in our builds. The fix is easy: Simply remove this call (SVN trunk has this fixed...).
Title: Re: [20.03] crossbuild for aarch64 fails because of asm('int3') usage
Post by: yopito on April 03, 2020, 08:44:16 am
OK, thanks for your reply. I will dig into SVN commits to find these fixes.
Title: Re: [20.03] crossbuild for aarch64 fails because of asm('int3') usage
Post by: Pecan on April 03, 2020, 07:10:18 pm
OK, thanks for your reply. I will dig into SVN commits to find these fixes.

I don't understand why you're seeing the asm(...) code. They're all guarded with a "#if defined LOGGING" guard.
Title: Re: [20.03] crossbuild for aarch64 fails because of asm('int3') usage
Post by: oBFusCATed on April 04, 2020, 10:19:26 am
The one we had to remove wasn't. See the git/svn log for details.