Build boot 1.40.0 on IBM z/OS (EBCDIC)

View: New views
4 Messages — Rating Filter:   Alert me  

Build boot 1.40.0 on IBM z/OS (EBCDIC)

by norbert.hanke@bluewin.ch :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi folks,

I am trying to build boost on the IBM Mainframe on z/OS USS.

I successfully modified the jam bootstrap script and have a running bjam binary now.
But when trying to build the boost libraries, I get the error below.
Does anybody have a hint what to look for? EBCDIC character encoding on my machine might be the reason: digits 0-9
are encoded as character values 240-249, but I have no idea where to start looking.



regards,

Norbert



> ./bjam

/home/u250672/boost_1_40_0/tools/build/v2/util/numbers.jam:22: in numbers.check from module numbers

error: 03 in 03 1 17

error: is not a number

/home/u250672/boost_1_40_0/tools/build/v2/build/version.jam:50: in version-less from module version

/home/u250672/boost_1_40_0/tools/build/v2/build/version.jam:102: in version.check-jam-version from module version

/home/u250672/boost_1_40_0/tools/build/v2/util/path.jam:172: in join from module path

/home/u250672/boost_1_40_0/tools/build/v2/util/path.jam:207: in path.root from module path

/home/u250672/boost_1_40_0/tools/build/v2/util/path.jam:247: in path.glob from module path

/home/u250672/boost_1_40_0/tools/build/v2/tools/types/register.jam:25: in load from module types/register

/home/u250672/boost_1_40_0/tools/build/v2/kernel/modules.jam:283: in import from module modules

/home/u250672/boost_1_40_0/tools/build/v2/tools/stage.jam:19: in load from module stage

/home/u250672/boost_1_40_0/tools/build/v2/kernel/modules.jam:283: in import from module modules

/home/u250672/boost_1_40_0/tools/build/v2/tools/builtin.jam:25: in load from module builtin

/home/u250672/boost_1_40_0/tools/build/v2/kernel/modules.jam:283: in import from module modules

/home/u250672/boost_1_40_0/tools/build/v2/build-system.jam:11: in load from module build-system

/home/u250672/boost_1_40_0/tools/build/v2/kernel/modules.jam:283: in import from module modules

/home/u250672/boost_1_40_0/tools/build/v2/kernel/bootstrap.jam:138: in boost-build from module

/home/u250672/boost_1_40_0/boost-build.jam:16: in module scope from module



_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Re: Build boot 1.40.0 on IBM z/OS (EBCDIC)

by Vladimir Prus-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

norbert.hanke@... wrote:

> Hi folks,
>
> I am trying to build boost on the IBM Mainframe on z/OS USS.
>
> I successfully modified the jam bootstrap script and have a running bjam binary now.
> But when trying to build the boost libraries, I get the error below.
> Does anybody have a hint what to look for? EBCDIC character encoding on my machine might be the
> reason: digits 0-9 are encoded as character values 240-249, but I have no idea where to start
> looking.
>
>
>
> regards,
>
> Norbert
>
>
>
>> ./bjam
>
> /home/u250672/boost_1_40_0/tools/build/v2/util/numbers.jam:22: in numbers.check from module
> numbers
>
> error: 03 in 03 1 17
>
> error: is not a number

Fun. The most relevant code is probably in tools/jam/src/regexp.c, and looks like this:

        case ANYBUT:
            if (*reginput == '\0' || strchr(OPERAND(scan), *reginput) != NULL)
                return(0);
            reginput++;
            break;

you might want to modify it like this:

        case ANYBUT:
            if (strcmp (reginput, "03") == 0)
                printf ("you were supposed to break here\n");
            if (*reginput == '\0' || strchr(OPERAND(scan), *reginput) != NULL)
                return(0);
            reginput++;
            break;

then rebuild bjam and set breakpoint on the printf. I am not aware of any assumptions
that 0-9 range is <0x80, but apparently something does not like this, or something else

- Volodya


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Re: Build boost 1.40.0 on IBM z/OS (EBCDIC)

by norbert.hanke@bluewin.ch :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

vladimir@... wrote:

>
>Fun. The most relevant code is probably in tools/jam/src/regexp.c, and looks like this:
>
>        case ANYBUT:
>            if (*reginput == '\0' || strchr(OPERAND(scan), *reginput) != NULL)
>                return(0);
>            reginput++;
>            break;
>
>you might want to modify it like this:
>
>        case ANYBUT:
>            if (strcmp (reginput, "03") == 0)
>                printf ("you were supposed to break here\n");
>            if (*reginput == '\0' || strchr(OPERAND(scan), *reginput) != NULL)
>                return(0);
>            reginput++;
>            break;
>
>then rebuild bjam and set breakpoint on the printf. I am not aware of any assumptions
>that 0-9 range is <0x80, but apparently something does not like this, or something else
>
>- Volodya

Thanks for the hint! Apparently, the match in numbers.jam is performed by the code in glob.c that assumes that all
character values are <128. Surprisingly it did not fail in a more drastic way since array bounds are being exceeded. I
adapted glob.c for EBCDIC and the numbers.check rule now works correctly.



Next I will have a closer look at regexp.c . It is being heavily used with expressions like [a-z] that have a very
strange meaning whithout taking into account that a-z on EBCDIC is not encoded as a consecutive range of character
values.



I keep you tuned on the progress.



regards,

Norbert

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Re: Build boost 1.40.0 on IBM z/OS (EBCDIC)

by norbert.hanke@bluewin.ch :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

In the meantime I modified both glob.c and regexp.c to correctly handle [a-z] constructs and inserted some additional
#include's here and there. bjam builds itself correctly.
I also set up a the tool definition - os390xlc.jam in my case - and now I can use my existing Jamfiles to build
my own projects. This is already a great step forward!



But when I try to build boost libraries bjam only finds one target and does nothing. What do I do wrong? See output
below.



regards,

Norbert



> ./bjam

WARNING: No python installation configured and autoconfiguration

        failed.  See http://www.boost.org/libs/python/doc/building.html
        for configuration instructions or pass
--without-python to

        suppress this message and silently skip all Boost.Python targets

Building the Boost C++ Libraries.

After the build, the headers will be located at

    /home/u250672/cpp/boost

The libraries will be located at

    /home/u250672/cpp/boost/stage/lib

Use 'bjam install --prefix=<path>' if you wish to
install headers and

libraries to a different location and remove the source tree.





...found 1 target...

>



I wrote:

>

>Thanks for the hint! Apparently, the match in numbers.jam is performed by the code in glob.c that assumes that all

>character values are <128. Surprisingly it did not fail in a more drastic way since array bounds are being exceeded.
I

>adapted glob.c for EBCDIC and the numbers.check rule now works correctly.

>

>

>

>Next I will have a closer look at regexp.c . It is being heavily used with expressions like [a-z] that have a very

>strange meaning whithout taking into account that a-z on EBCDIC is not encoded as a consecutive range of character

>values.

>

>

>

>I keep you tuned on the progress.

>

>

>

>regards,

>

>Norbert

>

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost