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

Fix #33, Resolve print format mismatches on 32-bit host #36

Merged
merged 1 commit into from
Apr 28, 2020

Conversation

skliper
Copy link
Contributor

@skliper skliper commented Apr 16, 2020

Describe the contribution
Casts where needed for print formatting on 32-bit host
Fix #33

Testing performed
Steps taken to test the contribution:

  1. CI - See https://travis-ci.com/github/skliper/cFS/builds/160575856
  2. Also built for vxworks on 32-bit host

Expected behavior changes
Builds for vxworks w/ 32-bit host

System(s) tested on

  • Hardware: CI, cross compiled for VxWorks 6.9 MCP750 on 32-bit linux host
  • OS: Ubuntu 18.04, VxWorks 6.9, Redhat 6.10
  • Versions: Bundle + this commit

Additional context
None (this isn't the only issue on vxworks, but haven't written them up yet)

Third party code
None

Contributor Info - All information REQUIRED for consideration of pull request
Jacob Hageman - NASA/GSFC

@skliper skliper added the bug Something isn't working label Apr 16, 2020
@skliper
Copy link
Contributor Author

skliper commented Apr 16, 2020

@astrogeco ready for CCB (no label yet)

@skliper skliper added this to the 3.2.0 milestone Apr 16, 2020
@astrogeco
Copy link
Contributor

@astrogeco ready for CCB (no label yet)

Thanks for the tag, I added the label

@astrogeco astrogeco closed this Apr 16, 2020
@astrogeco astrogeco reopened this Apr 16, 2020
Copy link
Contributor

@jphickey jphickey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes so far look OK, but it seems like some casts are still missing.

if (Verbose) printf(" sh_size = 0x%08lx\n", SectionHeader->Shdr64.sh_size);
if (Verbose) printf(" sh_addr = 0x%lx\n", (long unsigned int)SectionHeader->Shdr64.sh_addr);
if (Verbose) printf(" sh_offset = 0x%08lx\n", (long unsigned int)SectionHeader->Shdr64.sh_offset);
if (Verbose) printf(" sh_size = 0x%08lx\n", (long unsigned int)SectionHeader->Shdr64.sh_size);
if (Verbose) printf(" sh_link = 0x%08x\n", SectionHeader->Shdr64.sh_link);
if (Verbose) printf(" sh_info = 0x%08x\n", SectionHeader->Shdr64.sh_info);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For instance wouldn't the "sh_link" and "sh_info" need the same cast? (these are also words of different lengths depending on arch/binary format).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clarified pull request, urgent fix is for vxworks6.9, MCP750. As you mention, likely requires more casts for other systems but not a certification priority.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this related to VxWorks exactly? The tool runs on the host machine, not on VxWorks. Are the mismatches specific to running it on a 32-bit host machine vs 64-bit host machine?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True enough, this is a 32 bit host. I only fixed the issues that showed up for the vxworks build on the 32 bit host. I should have better described the test system.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, that makes more sense. But I'm still not an advocate of just minimally squelching the visible warnings on a specific 32-bit host (IIRC the machine with the VxWorks 6.9 tools is a 32-bit RHEL 6.x host). Other compilers/libraries might flag other printfs. Unless we actually add all the needed casts, warnings are likely reappear again as soon as someone builds on another system.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a step in the right direction, and removes a cert blocker. Making it work across compilers/libraries is a very valid open source concern, but not my priority.

@skliper skliper changed the title WIP: Fix #33, Resolve print format mismatches Partial #33, Resolve print format mismatches on vxworks Apr 16, 2020
@jphickey
Copy link
Contributor

jphickey commented Apr 16, 2020

With the the pull request title change this is even more unclear -- this tool doesn't have anything to do with VxWorks .... this tool is compiled for and runs on the build host no matter what the target OS is.

@skliper
Copy link
Contributor Author

skliper commented Apr 16, 2020

Good point. Likely an indication of too little time and too much work.

@skliper skliper changed the title Partial #33, Resolve print format mismatches on vxworks Fix #33, Resolve print format mismatches on 32-bit host Apr 16, 2020
@skliper
Copy link
Contributor Author

skliper commented Apr 22, 2020

20200422 CCB - APPROVED

@skliper skliper added CCB:Approved Indicates code approval by CCB and removed CCB:Ready labels Apr 22, 2020
@astrogeco astrogeco changed the base branch from master to integration-candidate April 28, 2020 14:18
@astrogeco astrogeco merged commit 7a00b66 into integration-candidate Apr 28, 2020
@skliper skliper deleted the fix33-format-mismatch branch May 5, 2020 11:53
@skliper skliper modified the milestone: 3.2.0 Aug 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CCB:Approved Indicates code approval by CCB
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fails to build under Raspbian and VxWorks
3 participants