Ryan Mansfield(deleted)
|
Re: Linker options for qcc: QNX Build Errors
|
Ryan Mansfield(deleted)
09/22/2014 10:08 AM
post111818
|
Re: Linker options for qcc: QNX Build Errors
On 14-09-21 04:37 PM, Anton Indrawan wrote:
> Hi Ryan,
>
> Yes, I am using the official QNX SDP 6.6.0 toolchain.
>
> Please use QCC to reproduce it.
> I think I've tried both with "QCC -Vgcc_ntoarmv7le" which links against to libcpp.so and "QCC Vgcc_ntoarmv7le -Y_gpp"
which links against libstdc++.so.
> Both options resulted in a shared library instead of an executable.
Sorry, yes I can. I misread your post. I thought you said it was only
happening with gcc drivers which was unexpected.
-fpic has been an alias to -shared in qcc for quite awhile (well before
6.6). One way around this behaviour is not to pass -fpic/-fPIC when
linking, or to just pass it directly to the compiler.
# qcc t.c -fpic -c
# qcc t.o
# file a.out
a.out: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
dynamically linked (uses shared libs), 0 bytes lazy stack, 4096 bytes
preallocated stack, not stripped
or
# qcc t.c -Wc,-fpic
# file a.out
a.out: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
dynamically linked (uses shared libs), 0 bytes lazy stack, 4096 bytes
preallocated stack, not stripped
Regards,
Ryan Mansfield
|
|
|