Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Architecture flag not set correctly with QNX SDP 7.0 #456

Open
craigsacco opened this issue Jul 9, 2019 · 2 comments
Open

[bug] Architecture flag not set correctly with QNX SDP 7.0 #456

craigsacco opened this issue Jul 9, 2019 · 2 comments
Labels
transition Transition to bfgroup/b2

Comments

@craigsacco
Copy link

craigsacco commented Jul 9, 2019

I was tackling an issue attempting to compile Boost 1.66.0 through QNX SDP 7.0 to target the x86_64 target. I discovered that the -V switch wasn't being inserted into the q++ command line when different architecture or address model settings are passed into B2.

A similar issue was raised last year (issue #339) but the solution is not satisfactory as simply passing the -V flag through the compileflags and linkflags properties will be ignored when creating static libraries.

I ended up retrofitting tools/qcc.jam with the following changes to make it work correctly.

NOTE: line numbers applying to the current version of the file, not the version in 1.66.0.

Below line 80:

toolset.flags qcc.compile OPTIONS <architecture>x86/<address-model>32 : -Vgcc_ntox86 ;
toolset.flags qcc.compile OPTIONS <architecture>x86/<address-model>64 : -Vgcc_ntox86_64 ;
toolset.flags qcc.compile OPTIONS <architecture>arm/<address-model>32 : -Vgcc_ntoarmv7le ;
toolset.flags qcc.compile OPTIONS <architecture>arm/<address-model>64 : -Vgcc_ntoaarch64le ;

Below line 173:

toolset.flags qcc.link OPTIONS <architecture>x86/<address-model>32 : -Vgcc_ntox86 ;
toolset.flags qcc.link OPTIONS <architecture>x86/<address-model>64 : -Vgcc_ntox86_64 ;
toolset.flags qcc.link OPTIONS <architecture>arm/<address-model>32 : -Vgcc_ntoarmv7le ;
toolset.flags qcc.link OPTIONS <architecture>arm/<address-model>64 : -Vgcc_ntoaarch64le ;

Below line 212:

toolset.flags qcc.archive OPTIONS <architecture>x86/<address-model>32 : -Vgcc_ntox86 ;
toolset.flags qcc.archive OPTIONS <architecture>x86/<address-model>64 : -Vgcc_ntox86_64 ;
toolset.flags qcc.archive OPTIONS <architecture>arm/<address-model>32 : -Vgcc_ntoarmv7le ;
toolset.flags qcc.archive OPTIONS <architecture>arm/<address-model>64 : -Vgcc_ntoaarch64le ;

Modified the line in the archive action (line 226):

From: "$(CONFIG_COMMAND)" -A "$(<)" "$(>)"
To: "$(CONFIG_COMMAND)" $(OPTIONS) -A "$(<)" "$(>)"

The last change is the most important as it was inadvertently calling the 32-bit version of ar to archive object files compiled through the 64-bit version of gcc.

@mjungnickel18
Copy link

At least for my try to get Boost 1.73 to compile for QNX 7 I had to add

toolset.flags qcc.compile++ OPTIONS x86/32 : -Vgcc_ntox86 ;
toolset.flags qcc.compile++ OPTIONS x86/64 : -Vgcc_ntox86_64 ;
toolset.flags qcc.compile++ OPTIONS arm/32 : -Vgcc_ntoarmv7le ;
toolset.flags qcc.compile++ OPTIONS arm/64 : -Vgcc_ntoaarch64le ;

As well to compile C and C++ code for the correct architecture.
And of course add the fix of #453

@stale
Copy link

stale bot commented May 29, 2021

Thank you for your contributions. Main development of B2 has moved to https://github.com/bfgroup/b2
This issue has been automatically marked as "transition" to indicate the potential for needing transition to the new B2 development project.

@stale stale bot added the transition Transition to bfgroup/b2 label May 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
transition Transition to bfgroup/b2
Projects
None yet
Development

No branches or pull requests

2 participants