Open mrhyzhou opened 6 years ago
Not super familiar with that architecture, but there was a contribution a while back to get scanner.c
to compile on ARM. See https://github.com/openvenues/libpostal/pull/152.
Might try something like --with-cflags-scanner-extra="-maarch64"
during configure
and compile from there.
Thanks @albarrentine. the build flag is not supported by QNX7's ntoaarch64-gcc:
ntoaarch64-gcc: error: unrecognized command line option '-maarch64'
I will investigate if the similar flag is available on QNX7. In the meanwhile, would you know what re2c arguments were used when generating the scanner file? I want to see if I can workaround this by tweaking the file.
Thanks!
The version of re2c used is generated as a comment at the top of the scanner.c
file. The lexer
directive in src/Makefile.am
contains the command for building scanner.c
:
lexer: scanner.re
re2c -F -s -b -8 -o scanner.c scanner.re
Since the file is generated, I would not recommend tweaking it directly, as it may affect tokenization, and thus the parser results.
Thanks for pointing out the lexer directive. I am planning to tweak the options of the re2c command, see I can generate a scanner.c that can workaround the error.
@mrhyzhou Were you able to resolve the issue for qnx platform?
@roadrunner20 It worked for me after added this flag"-Wc,-mmarch64"
to with-cflags-scanner-extra
. -Wc
flag passes build options to gcc through qcc. Hope this hopes.
Adding it via with-cflags-scanner-extra
didnt work for me. But I managed to make it work by adding it to the CFLAGS
like CFLAGS="${CFLAGS} -mmarch64"
.
Hello,
First of all, I just want to say thank you for making this fantastic tool available for everyone!
I am working on integrating libpostal into my project, which compiles on QNX aarch64, by using Buildroot system. I am running into a build error that I couldn't workaround. It is a assembler error, looks like this:
By looking at the error, is seems like the compiler is having issue with the huge "jump" statements in the auto generated scanner.c file. I have tried few things to fix it, like using 0 optimiztion, disable-sse2, etc, but had no luck. Is anyone else having this issue? Any suggestion to workaround this? Any help is appropriated.
FYI, I have tried the latest v1.1 alpha, and other old versions, the problem persisted.