bmx-ng / bmk

The enhanced BlitzMax build program.
zlib License
28 stars 13 forks source link

"bmk makemods -r -l android -g armeabi" tries to use x86-interface #17

Closed GWRon closed 9 years ago

GWRon commented 9 years ago

Running

$  ./bmk makemods -r -l android -g armeabi

leads to

...
[ 54%] Processing:sdlmax2d.bmx
Compile Error: Can't find interface for module 'brl.blitz'
[/blitzkeywords.debug.android.x86.i;9;0]
Build Error: failed to compile (65280) /BlitzMaxNG/mod/sdl.mod/sdlmax2d.mod/sdlmax2d.bmx

Somehow it uses blitzkeywords.debug.android.x86.i instead of blitzkeywords.release.android.armeabi.i

Seems as bmk changes opinion about release/debug and processor inbetween.

Edit: Seems that is actually a "bcc"-issue, not a "bmk"-one.

GWRon commented 9 years ago

So it seems, "BMK" does not give the "-g" param as "-g" to "BCC":

$  ./bmk makemods -v -r -l android -g armeabi
[ 54%] Processing:sdlmax2d.bmx
/BlitzMaxNG/bin/bcc  -p android -o /BlitzMaxNG/mod/sdl.mod/sdlmax2d.mod/.bmx/sdlmax2d.bmx.release.android.s /BlitzMaxNG/mod/sdl.mod/sdlmax2d.mod/sdlmax2d.bmx

Solution for this: bmk - bmk_util.bmx:

Function CompileBMX( src$,obj$,opts$ )
...
    If processor.BCCVersion() = "BlitzMax" Then
...
    Else
...
'append
        opts :+ " -g " + processor.CPU()
    End If
...

But maybe this is not intended in this function (your "fat archives" might do something similar - or are at least intended to do that)

Edit: For the wrong "debug" instead of "release" I found something odd: bcc has "opt_release" - and - "opt_debug" - for whatever reasons as they both should switch between "debug or not to debug"

GWRon commented 9 years ago

Ok ... there is a potential flaw in BMK:

Function MakeModules( args$[] )
...
    BeginMake

    Local buildManager:TBuildManager = New TBuildManager

    buildManager.MakeMods(mods, opt_all)
    buildManager.DoBuild()

BeginMake() resets cc_opts and bcc_opts - so before doing the module build itself, all flags are reset to "null" - maybe this is something to consider.

For now I did adjust it similar to issue #16 : I appended something to CompileBMX()

Function CompileBMX( src$,obj$,opts$ )
...
    Else
        ' remove any "legacy" generated source.
        DeleteFile azm + ".s"

        opts :+ " -p " + processor.Platform()
'appended in issue #16
        opts :+ " -g " + processor.CPU()
'appended in this issue here
        if opt_debug
            opts :+ " -d "
        else
            opts :+ " -r "
        endif
...
End Function

Afterwards I had to manually update brl.mod and pub.mod via $ ./bmk makemods -a -r -l android -g armeabi pub and afterwards $ ./bmk makemods -a -r -l android -g armeabi brl

-> now every module compiled successfully (with blitz.mod being the exception - except you explicitely build with "brl"-module-limitation)

GWRon commented 9 years ago

Issue solved (partially?)

OK ... reverted to base ... and recognized: "DEBUG:int = True" in my "bcc/config.bmx"-file (someone from very near your living location suggested me that some days ago when I had some trouble).

So the "real bug" is just this one: if "DEBUG:int = True", then somehow "bmk" should get informed to not name the files according to the params "bmk" got, but the params "bcc" used.

I leave that issue open for you to read and close afterwards.

GWRon commented 9 years ago

I do not want to create a new issue, as it might be something related to "my current issues" presented above:

[ 95%] Processing:sdltimer.bmx
[ 96%] Compiling:graphics.bmx.release.android.armeabi.c
[ 96%] Compiling:sdltimer.bmx.release.android.armeabi.c
[ 96%] Archiving:graphics.release.android.armeabi.a
[ 96%] Archiving:sdltimer.release.android.armeabi.a
/path_to_my_64bit_ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ar: creating /BlitzMaxNG/mod/brl.mod/graphics.mod/graphics.release.android.armeabi.a
/path_to_my_64bit_ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ar: creating /BlitzMaxNG/mod/sdl.mod/sdltimer.mod/sdltimer.release.android.armeabi.a
[ 96%] Processing:driver.bmx
[ 96%] Processing:sdlgraphics.bmx
[ 97%] Compiling:driver.bmx.release.android.armeabi.c
[ 97%] Compiling:sdlgraphics.bmx.release.android.armeabi.c
[ 97%] Processing:image.bmx
[ 97%] Archiving:sdlgraphics.release.android.armeabi.a
/path_to_my_64bit_ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ar: creating /BlitzMaxNG/mod/sdl.mod/sdlgraphics.mod/sdlgraphics.release.android.armeabi.a
[ 97%] Compiling:image.bmx.release.android.armeabi.c
[ 97%] Processing:glsdlgraphics.bmx
[ 98%] Processing:imagefont.bmx
[ 98%] Compiling:glsdlgraphics.bmx.release.android.armeabi.c
/BlitzMaxNG/mod/sdl.mod/glsdlgraphics.mod/.bmx/glsdlgraphics.bmx.release.android.armeabi.c: In function 'sdl_glsdlgraphics_BeginOrtho':
/BlitzMaxNG/mod/sdl.mod/glsdlgraphics.mod/.bmx/glsdlgraphics.bmx.release.android.armeabi.c:21:16: error: 'GLbitfield' undeclared (first use in this function)
  glPushAttrib((GLbitfield)274432);
                ^
/BlitzMaxNG/mod/sdl.mod/glsdlgraphics.mod/.bmx/glsdlgraphics.bmx.release.android.armeabi.c:21:16: note: each undeclared identifier is reported only once for each function it appears in
/BlitzMaxNG/mod/sdl.mod/glsdlgraphics.mod/.bmx/glsdlgraphics.bmx.release.android.armeabi.c:21:27: error: expected ')' before numeric constant
  glPushAttrib((GLbitfield)274432);
                           ^
/BlitzMaxNG/mod/sdl.mod/glsdlgraphics.mod/.bmx/glsdlgraphics.bmx.release.android.armeabi.c:22:17: error: 'GLenum' undeclared (first use in this function)
  glGetIntegerv((GLenum)2978,(GLint*)((BBINT*)BBARRAYDATA(bbt_vp,bbt_vp->dims)));
                 ^
/BlitzMaxNG/mod/sdl.mod/glsdlgraphics.mod/.bmx/glsdlgraphics.bmx.release.android.armeabi.c:22:24: error: expected ')' before numeric constant
  glGetIntegerv((GLenum)2978,(GLint*)((BBINT*)BBARRAYDATA(bbt_vp,bbt_vp->dims)));
                        ^
/BlitzMaxNG/mod/sdl.mod/glsdlgraphics.mod/.bmx/glsdlgraphics.bmx.release.android.armeabi.c:23:23: error: expected ')' before numeric constant
  glGetDoublev((GLenum)2982,(GLdouble*)((BBDOUBLE*)BBARRAYDATA(sdl_glsdlgraphics_ortho_mv,sdl_glsdlgraphics_ortho_mv->dims)));
                       ^
/BlitzMaxNG/mod/sdl.mod/glsdlgraphics.mod/.bmx/glsdlgraphics.bmx.release.android.armeabi.c:24:23: error: expected ')' before numeric constant
  glGetDoublev((GLenum)2983,(GLdouble*)((BBDOUBLE*)BBARRAYDATA(sdl_glsdlgraphics_ortho_pj,sdl_glsdlgraphics_ortho_pj->dims)));
                       ^
/BlitzMaxNG/mod/sdl.mod/glsdlgraphics.mod/.bmx/glsdlgraphics.bmx.release.android.armeabi.c:25:23: error: expected ')' before numeric constant
  glMatrixMode((GLenum)5888);
                       ^
....
woollybah commented 9 years ago

sdl.sdlmax2d is no longer part of the repository.

GWRon commented 9 years ago

uhhmmm... That ... explains things.

sdl.mod was no longer a symlink in my NG-directory (had some trouble in the past with the symlinks - like I explained to you) - so "sdl.mod" was a hard copy - of a very outdated revision - replacing with a symlink made it compile like it should.

Did I mention that most of the problems sit in front of the computer?