Project Home
Project Home
Source Code
Source Code
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
BroadcastCommunity.qnx.com will be offline from May 31 6:00pm until June 2 12:00AM for upcoming system upgrades. For more information please go to https://community.qnx.com/sf/discussion/do/listPosts/projects.bazaar/discussion.bazaar.topc28418
Forum Topic - QNX SDP 6.6 binary compatibility on a QNX SDP 6.5 target: (13 Items)
   
QNX SDP 6.6 binary compatibility on a QNX SDP 6.5 target  
Hi guys,

I understood that binaries produced by QNX 6.5 toolchain will work on QNX 6.6 targets. I was wondering whether the other
 way around would work. So, I created a hello world application which basically does a printf, compiled with QNX 6.6's 
QCC, deployed on a QNX 6.5 target and that worked. However, when I was using std::pow, it threw a memory fault.

Here is the test code:
#include <stdio.h>
#include <math.h>

int main()
{
  double result = std::pow(2.0, 2);
  printf("Result: %lf\n", result);
  return 0;
}

Compile with: QCC -Vgcc_ntoarmv7le -Bstatic -lcpp math.cpp -lm.

Note: I statically linked the program against libcpp and libm using the -Bstatic option. Can somebody confirm that this 
is the right way to statically link to the static libcpp library.

Best regards,
Anton
Re: QNX SDP 6.6 binary compatibility on a QNX SDP 6.5 target  
On 14-09-22 03:54 AM, Anton Indrawan wrote:
> Hi guys,
>
> I understood that binaries produced by QNX 6.5 toolchain will work on QNX 6.6 targets. I was wondering whether the 
other way around would work. So, I created a hello world application which basically does a printf, compiled with QNX 6.
6's QCC, deployed on a QNX 6.5 target and that worked. However, when I was using std::pow, it threw a memory fault.

Running newer binaries on older versions of the OS might work, but it's 
not guaranteed to work so it's an unsupported use case.

> Note: I statically linked the program against libcpp and libm using the -Bstatic option. Can somebody confirm that 
this is the right way to statically link to the static libcpp library.

Yes, but leaving it without a -Bdynamic, means the -lc that the compiler 
drivers automatically link in will be statically linked as well. If you 
want to create a full static binary, then you should link with -static. 
If you still want dynamically linked program, you need to link against 
libc.so, in which case you should to do, -Bstatic -lcpp -Bdynamic

Regards,

Ryan Mansfield

Re: QNX SDP 6.6 binary compatibility on a QNX SDP 6.5 target  
> On 14-09-22 03:54 AM, Anton Indrawan wrote:
> > Hi guys,
> >
> > I understood that binaries produced by QNX 6.5 toolchain will work on QNX 6.
> 6 targets. I was wondering whether the other way around would work. So, I 
> created a hello world application which basically does a printf, compiled with
>  QNX 6.6's QCC, deployed on a QNX 6.5 target and that worked. However, when I 
> was using std::pow, it threw a memory fault.
> 
> Running newer binaries on older versions of the OS might work, but it's 
> not guaranteed to work so it's an unsupported use case.
> 
Anton: Thanks for your reply. I will take that input into account.


> > Note: I statically linked the program against libcpp and libm using the -
> Bstatic option. Can somebody confirm that this is the right way to statically 
> link to the static libcpp library.
> 
> Yes, but leaving it without a -Bdynamic, means the -lc that the compiler 
> drivers automatically link in will be statically linked as well. If you 
> want to create a full static binary, then you should link with -static. 
> If you still want dynamically linked program, you need to link against 
> libc.so, in which case you should to do, -Bstatic -lcpp -Bdynamic
> 
> Regards,
> 
> Ryan Mansfield
> 

@Ryan:
Anton: I tried the following command
QCC -Vgcc_ntoarmv7le -Bstatic -lcpp -Bdynamic helloworld.cpp

but the resulting binary still contains a dependency to the shared libcpp library.

  Tag        Type                         Name/Value
 0x00000001 (NEEDED)                     Shared library: [libcpp.so.5]
 0x00000001 (NEEDED)                     Shared library: [libc.so.3]

I am not sure how I can just statically link to the static libcpp library.
Could you also reproduce it?


@Mario: If I could use the QNX 6.6 toolchain for building binaries (at least with statically linked libcpp library) 
which can be deployed on a QNX 6.5 target, it would save me lots of linking time. In my case, linking my big app using 
the QNX 6.5's ld takes ~15-20 minutes or even more, while using QNX 6.6's ld is much faster. I am not sure how fast it 
is, but it won't take longer than 5 minutes.

Thanks,
Anton
RE: QNX SDP 6.6 binary compatibility on a QNX SDP 6.5 target  

-----Message d'origine-----
De : Anton Indrawan [mailto:community-noreply@qnx.com] 
Envoyé : 22 septembre 2014 17:09
À : general-toolchain
Objet : Re: QNX SDP 6.6 binary compatibility on a QNX SDP 6.5 target


>@Mario: If I could use the QNX 6.6 toolchain for building binaries (at least with statically linked libcpp library) 
>which can be deployed on a QNX 6.5 target, it would save me lots of linking time. In my case, linking my big app
>  using the QNX 6.5's ld takes ~15-20 minutes or even more, while using QNX 6.6's ld is much faster.
>  I am not sure how fast it is, but it won't take longer than 5 minutes.

Can't you just use 4.8.3 and the bin utils for 6.5.0 ?

Thanks,
Anton




_______________________________________________

General
http://community.qnx.com/sf/go/post111830
To cancel your subscription to this discussion, please e-mail general-toolchain-unsubscribe@community.qnx.com
Re: RE: QNX SDP 6.6 binary compatibility on a QNX SDP 6.5 target  
Hi Mario,

Will this work on a standard QNX 6.5 target?
I don't make the target image, so I don't really know if this would work.

Best regards,
Anton
Re: RE: QNX SDP 6.6 binary compatibility on a QNX SDP 6.5 target  
Yes that is exactly what I`m doing.  There is release of 4.8.3 for 650 and another 4.8.3 for 6.6.0.
Re: RE: QNX SDP 6.6 binary compatibility on a QNX SDP 6.5 target  
Hi Mario,

Thanks for your information.

However, the libcpp.so under the GCC 4.8.3 seems to intentionally be pointing to a non-existent file. I am not sure if I
 can take it from the standard QNX 6.5 toolchain. I will give it a try later.

Best regards,
Anton
RE: RE: QNX SDP 6.6 binary compatibility on a QNX SDP 6.5 target  
Dinkum is not supply with 4.8.3, you must use gnu ( libstdc++.so ), sorry should have mentioned that.

QNX Support offered to build me a version of the Dinkum libs, but I declined, switching to libstdc++ turned out to be 
positive for us.  Had I known I would have switch to it earlier.

-----Message d'origine-----
De : Anton Indrawan [mailto:community-noreply@qnx.com] 
Envoyé : 26 septembre 2014 16:13
À : general-toolchain
Objet : Re: RE: QNX SDP 6.6 binary compatibility on a QNX SDP 6.5 target

Hi Mario,

Thanks for your information.

However, the libcpp.so under the GCC 4.8.3 seems to intentionally be pointing to a non-existent file. I am not sure if I
 can take it from the standard QNX 6.5 toolchain. I will give it a try later.

Best regards,
Anton



_______________________________________________

General
http://community.qnx.com/sf/go/post111901
To cancel your subscription to this discussion, please e-mail general-toolchain-unsubscribe@community.qnx.com
Re: QNX SDP 6.6 binary compatibility on a QNX SDP 6.5 target  
On 14-09-22 05:08 PM, Anton Indrawan wrote:
> @Ryan:
> Anton: I tried the following command
> QCC -Vgcc_ntoarmv7le -Bstatic -lcpp -Bdynamic helloworld.cpp
>
> but the resulting binary still contains a dependency to the shared libcpp library.
>
>    Tag        Type                         Name/Value
>   0x00000001 (NEEDED)                     Shared library: [libcpp.so.5]
>   0x00000001 (NEEDED)                     Shared library: [libc.so.3]
>
> I am not sure how I can just statically link to the static libcpp library.
> Could you also reproduce it?

When you link C++, qcc automatically links against libcpp. You should 
specify -nostdlib++. e.g.

$ qcc  math.cpp -Bstatic -lcpp -lcxa -lm -Bdynamic -nostdlib++
$ ntox86-readelf -d a.out | grep NEEDED
  0x00000001 (NEEDED)                     Shared library: [libc.so.3]

One problem you might hit trying to get 6.6.0 binaries to run on 6.5.0, 
is that everything is built is with -fstack-protector, which relies on 
support in libc. This wasn't in the 6.5.0 libc but IIRC, 6.5.0SP1 added.

Regards,

Ryan Mansfield
Re: QNX SDP 6.6 binary compatibility on a QNX SDP 6.5 target  
Hi Ryan,

This works well. Thank you.

Best regards,
Anton
Re: QNX SDP 6.6 binary compatibility on a QNX SDP 6.5 target  
> Can't you just use 4.8.3 and the bin utils for 6.5.0 ?
>
> Thanks,
> Anton

@Mario/@Ryan,

What is the exact tag/release of bin utils that is required/recommended to use the 4.8.3 compiler targeting QNX 6.5?

And would this then support C++11 library?

Thanks,
John
RE: QNX SDP 6.6 binary compatibility on a QNX SDP 6.5 target  
Ryan doesn't seem to be working for QNX anymore.

Currently using 2.24.

And yes C++11 works, mostly, as 4.8.3 is not fully compliant.

-----Message d'origine-----
De : John Hagen [mailto:community-noreply@qnx.com] 
Envoyé : 21 janvier 2016 18:37
À : general-toolchain <general-toolchain@community.qnx.com>
Objet : Re: QNX SDP 6.6 binary compatibility on a QNX SDP 6.5 target

> Can't you just use 4.8.3 and the bin utils for 6.5.0 ?
>
> Thanks,
> Anton

@Mario/@Ryan,

What is the exact tag/release of bin utils that is required/recommended to use the 4.8.3 compiler targeting QNX 6.5?

And would this then support C++11 library?

Thanks,
John



_______________________________________________

General
http://community.qnx.com/sf/go/post115585
To cancel your subscription to this discussion, please e-mail general-toolchain-unsubscribe@community.qnx.com
RE: QNX SDP 6.6 binary compatibility on a QNX SDP 6.5 target  
Why would you want to do that ?

-----Message d'origine-----
De : Anton Indrawan [mailto:community-noreply@qnx.com] 
Envoyé : 22 septembre 2014 03:55
À : general-toolchain
Objet : QNX SDP 6.6 binary compatibility on a QNX SDP 6.5 target

Hi guys,

I understood that binaries produced by QNX 6.5 toolchain will work on QNX 6.6 targets. I was wondering whether the other
 way around would work. So, I created a hello world application which basically does a printf, compiled with QNX 6.6's 
QCC, deployed on a QNX 6.5 target and that worked. However, when I was using std::pow, it threw a memory fault.

Here is the test code:
#include <stdio.h>
#include <math.h>

int main()
{
  double result = std::pow(2.0, 2);
  printf("Result: %lf\n", result);
  return 0;
}

Compile with: QCC -Vgcc_ntoarmv7le -Bstatic -lcpp math.cpp -lm.

Note: I statically linked the program against libcpp and libm using the -Bstatic option. Can somebody confirm that this 
is the right way to statically link to the static libcpp library.

Best regards,
Anton



_______________________________________________

General
http://community.qnx.com/sf/go/post111814
To cancel your subscription to this discussion, please e-mail general-toolchain-unsubscribe@community.qnx.com