Skip to content

Actually test linker script processing #6578

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

Merged

Conversation

tautschnig
Copy link
Collaborator

The goto-cc personality does not invoke linker script processing, hence
the tests located in the ansi-c folder were a no-op. Moving them to the
goto-gcc folder showed that they wouldn't work as is, which is also
fixed now:

  1. Add the -N option so as not to generate ELF headers, which those
    linker scripts leave no room for.
  2. Make goto-cc accept (but ignore) the -N option. (Cosmetic change
    only.)
  3. Actually detect failure of linker script parsing by enabling warnings
    and testing for them.
  4. Make sure ls_parse.py is available on the PATH.
  • Each commit message has a non-empty body, explaining why the change was made.
  • n/a Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

Copy link
Contributor

@chrisr-diffblue chrisr-diffblue left a comment

Choose a reason for hiding this comment

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

Good catch!

@tautschnig tautschnig force-pushed the bugfixes/linker-script-testing branch from 97f37d8 to 350d56e Compare January 13, 2022 16:41
@tautschnig tautschnig self-assigned this Jan 13, 2022
@codecov
Copy link

codecov bot commented Jan 13, 2022

Codecov Report

Merging #6578 (4f84963) into develop (4f135cc) will increase coverage by 0.18%.
The diff coverage is 90.86%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #6578      +/-   ##
===========================================
+ Coverage    76.01%   76.20%   +0.18%     
===========================================
  Files         1579     1579              
  Lines       181293   181291       -2     
===========================================
+ Hits        137805   138144     +339     
+ Misses       43488    43147     -341     
Impacted Files Coverage Δ
src/analyses/local_may_alias.cpp 63.80% <0.00%> (ø)
src/cpp/cpp_typecheck_constructor.cpp 89.00% <ø> (ø)
src/cpp/cpp_typecheck_initializer.cpp 29.26% <0.00%> (ø)
src/goto-instrument/contracts/contracts.h 100.00% <ø> (ø)
...trument/contracts/havoc_assigns_clause_targets.cpp 97.72% <ø> (ø)
src/goto-instrument/function.cpp 0.00% <0.00%> (ø)
src/goto-programs/allocate_objects.h 100.00% <ø> (ø)
src/goto-programs/graphml_witness.cpp 53.37% <0.00%> (+0.14%) ⬆️
src/util/c_types.h 100.00% <ø> (ø)
src/goto-programs/string_instrumentation.cpp 25.29% <25.00%> (-0.36%) ⬇️
... and 54 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 087296a...4f84963. Read the comment docs.

@tautschnig tautschnig force-pushed the bugfixes/linker-script-testing branch 3 times, most recently from e204a67 to a4e2588 Compare January 13, 2022 23:43
The goto-cc personality does not invoke linker script processing, hence
the tests located in the ansi-c folder were a no-op. Moving them to the
goto-gcc folder showed that they wouldn't work as is, which is also
fixed now:

1) Add -static so as not to generate dynamic linking headers, which
those linker scripts leave no room for.
2) Actually detect failure of linker script parsing by enabling warnings
and testing for them.
3) Make sure ls_parse.py is available on the PATH.
4) Linker scripts aren't supported by Apple's linker.
There is no need to re-implement logic that src/common already takes
care of. Also, we identify Visual Studio in that way, so shouldn't
deviate from this for another platform.
@tautschnig tautschnig force-pushed the bugfixes/linker-script-testing branch from a4e2588 to 4f84963 Compare January 14, 2022 10:57
@tautschnig tautschnig merged commit 181ab42 into diffblue:develop Jan 14, 2022
@tautschnig tautschnig deleted the bugfixes/linker-script-testing branch January 14, 2022 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants