[odb-users] Support for ODB on QNX

Juan Pablo Samper jp.samper at apex.ai
Fri Aug 21 20:13:07 EDT 2020


Hi Boris,

When compiling a file generated by the odb compiler, I get the following
errors:

analysis_result_odb.cpp:105:11: error: '::__time_t' has not been declared
analysis_result_odb.cpp:114:7: error: '::__suseconds_t' has not been
declared

Sure enough, if I search in the QNX toolchain, __time_t and __suseconds_t
do not exist. However, I do find __TIME_T and __SUSECONDS_T, and time_t and
suseconds_t.
In linux, the types are defined in bits/types.h

I can work around the error by adding, e.g., typedef __TIME_T __time_t in
some QNX headers, which is kind of hacky (but works :P).

I guess the question is what component (odb, libodb-mysql, qnx toolchain,
etc.) is responsible to make sure __time_t is available?
Or put differently, should I be creating a ticket for QNX support people or
is this a new use-case for ODB?

You should be able to generate the same file by using the files in the
performance_test project:
https://gitlab.com/ApexAI/performance_test/-/tree/qnx_perf_test_odb.
The underlying command used to generate the files:
$ odb \
    -d mysql \
    --generate-query \
    --generate-session \
    --generate-schema \
    --schema-format embedded --std c++11 \
    --changelog-dir
/home/jp.samper/workspace/performance_test/performance_test/schema_changelog
\
    --profile boost/uuid -x -DPERFORMANCE_TEST_ODB_FOR_SQL_ENABLED \
    --output-dir
/home/jp.samper/workspace/performance_test/build/performance_test/odb_gen \
    --hxx-suffix .hpp \
    --ixx-suffix _inline.hpp \
    --cxx-suffix .cpp \
    --odb-file-suffix _odb \

-I/home/jp.samper/workspace/performance_test/performance_test/src/experiment_configuration
\

-I/home/jp.samper/workspace/performance_test/performance_test/src/experiment_execution
\
    -I/tmp/qnx_toolchain/qnx700_bl/target/qnx7/aarch64le/opt/odb/include \
    src/experiment_execution/analysis_result.hpp

(also src/experiment_configuration/experiment_configuration.hpp)

I'm using odb 2.5.0-b.19+1 compiled with gcc 7.5.0 on Ubuntu 18.04.

Best,
JP

On Fri, Aug 21, 2020 at 9:18 AM Juan Pablo Samper <jp.samper at apex.ai> wrote:

> Hi Boris,
>
> I noticed my mistake: I was running `bpkg create -d conf *cxx`. *Once I
> used `cc`, no warning.
>
> I did try to use the QNX-provided libssl and libcrypto, and I ran into the
> following:
>
> $ bpkg build libmysqlclient ?sys:libssl ?sys:libcrypto
> error: unable to import target libssl%lib{ssl}
>   info: use config.import.libssl configuration variable to specify its
> project out_root
>   info: or use config.import.libssl.ssl.lib configuration variable to
> specify its path
> error: unable to import target libssl%lib{ssl}
>   info: use config.import.libssl configuration variable to specify its
> project out_root
>   info: or use config.import.libssl.ssl.lib configuration variable to
> specify its path
>
> So then I set  config.import.libssl.ssl.lib in the build/config.build:
>
> config.import.libssl.ssl.lib = /path/to/qnx/usr/lib
>
> But then bpkg crashes:
>
> $ bpkg build libmysqlclient ?sys:libssl ?sys:libcrypto
> b:
> /home/jp.samper/workspace/odb_ws/build2-build/build2-toolchain-0.13/build2-0.13.0/libbuild2/target.cxx:550:
> std::ostream& build2::to_stream(std::ostream&, const build2::target_key&,
> butl::optional<build2::stream_verbosity>): Assertion `!k.ext' failed.
> error: process b terminated abnormally: aborted (SIGABRT) (core dumped)
>
> I assumed it was just an RTFM moment on how to configure the path to the
> library,
> so I decided to set it aside and come back to it if compiling from source
> didn't work, but
> since we are already here, maybe you can tell me what I'm doing wrong?
>
> Thanks!
> JP
>
> On Thu, Aug 20, 2020 at 9:15 PM Boris Kolpackov <boris at codesynthesis.com>
> wrote:
>
>> Juan Pablo Samper <jp.samper at apex.ai> writes:
>>
>> > It required patching libcrypto and libmysqlclient to account for some
>> > QNX-specific options.
>>
>> You can also use QNX-supplied versions of these if you would like
>> (especially libcrypto/libssl). See notes on using system-installed
>> dependencies in odb/install-build2.xhtml.
>>
>>
>> > $ bpkg build libz
>> > ...
>> > libz-1.2.1100+1/build/root.build:6:7: error: cxx and c module target
>> > mismatch
>> >   info: cxx is 'aarch64-nto-qnx7.0.0'
>> >   info: c is 'aarch64-nto-qnx7.0.0'
>> >   info: consider explicitly specifying config.cxx and config.c
>>
>> Yes, this is the same issue.
>>
>>
>> > I then run bpkg build libz again and everything compiles successfully,
>> but
>> > it prints the following warning:
>> >
>> > $ bpkg build libz
>> > ...
>> > libz-1.2.1100+1/build/config.build: warning: saving previously inherited
>> > variable config.c
>>
>> Hm, strange. This sequence of steps doesn't issue any warnings for me:
>>
>> bpkg create -d conf cc config.cxx=g++ config.c=gcc
>> bpkg build -d conf libz at https://pkg.cppget.org/1/stable
>>
>>
>> > The actual quirk that would be nice to iron out is that if I try to set
>> > config.c and config.c.target when running bpkg create, bpkg drops it:
>> >
>> > qnx-aarch64-with-c/build/config.build: warning: dropping no longer used
>> > variable config.c
>>
>> What is the exact sequence of steps to reproduce this? And this is using
>> build2 0.13.0, correct?
>>
>
>
> --
>
> Juan Pablo Samper
>
> Software Tooling and Infrastucture
>
> Apex.AI
>
> www.apex.ai
>
>

-- 

Juan Pablo Samper

Software Tooling and Infrastucture

Apex.AI

www.apex.ai


More information about the odb-users mailing list