Author Topic: [20.03] crossbuild for aarch64 fails because of asm('int3') usage  (Read 1023 times)

Offline yopito

  • Single posting newcomer
  • *
  • Posts: 4
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: [Select]
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

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9606
Re: [20.03] crossbuild for aarch64 fails because of asm('int3') usage
« Reply #1 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...).
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline yopito

  • Single posting newcomer
  • *
  • Posts: 4
Re: [20.03] crossbuild for aarch64 fails because of asm('int3') usage
« Reply #2 on: April 03, 2020, 08:44:16 am »
OK, thanks for your reply. I will dig into SVN commits to find these fixes.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2267
Re: [20.03] crossbuild for aarch64 fails because of asm('int3') usage
« Reply #3 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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12910
    • Travis build status
Re: [20.03] crossbuild for aarch64 fails because of asm('int3') usage
« Reply #4 on: April 04, 2020, 10:19:26 am »
The one we had to remove wasn't. See the git/svn log for details.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]