QNX 编译器支持 -wrapper 标志

问题描述 投票:0回答:1

根据GCC手册上的

-wrapper
标志如下:-

-wrapper Invoke all subcommands under a wrapper program. The name of the wrapper program and its parameters are passed as a comma separated list.

    gcc -c t.c -wrapper gdb,--args

因此,我们使用此标志

-wrapper
从自定义路径加载库,而不是使用 gcc 编译命令从系统路径获取库,如下所示:-

gcc-7.3.0/bin/x86_64-pc-linux-gnu-gcc -wrapper /home/hosts/Linux-x86/unix-build/lib/ld-linux.so.2,--library-path,/home/hosts/Linux-x86/unix-build/lib .....

在编译“x86_64”架构时,它按预期工作正常。现在我们需要为

QNX aarch64
平台设置构建,我们通过 -wrapper 标志遵循相同的方法:-

usr/bin/qcc -V12.2.0,gcc_ntoaarch64le -wrapper /home/hosts/Linux-x86/unix-build/lib/ld-linux.so.2,--library-path,/home/hosts/Linux-x86/unix-build/lib -fdata-sections -ffunction-sections

Build 无法识别

-wrapper
标志。它会抛出错误:-
cc: unknown option: '-wrapper'

我在 QNX 论坛中找不到任何有关此内容的文档。任何解决此问题的帮助/建议都会很有帮助。

我期待

qcc
编译器与
-wrapper
标志一起工作。

我尝试了以下其他替代方案,但没有运气:-

  1. 使用

    -rpath
    :-

    /usr/bin/qcc -V12.2.0,gcc_ntoaarch64le -Wl,-rpath,/home/hosts/Linux-x86/unix-build/lib ....

  2. 使用

    --library-path
    从自定义路径加载库:-

    /home/unix-build/lib64/ld-linux-x86-64.so.2 --library-path /home/unix-build/lib usr/bin/qcc -V12.2.0,gcc_ntoaarch64le ....

它尝试从标准路径中选择库,但构建失败并出现错误:-

aarch64-unknown-nto-qnx8.0.0/12.2.0/cc1: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found
c++ gcc compilation dynamic-linking qnx
1个回答
0
投票

我期待 qcc 编译器与 -wrapper 标志一起工作。

您的期望是没有根据的:

qcc
不是
gcc
,并且没有记录支持的
-wrapper
标志。

我们使用此标志 -wrapper 从自定义路径加载库,而不是使用 gcc 编译命令从系统路径获取库,如下所示

为什么? http://xyproblem.info 似乎适用于此。

© www.soinside.com 2019 - 2024. All rights reserved.