Skip to content

Ignore .s files (assembly) in compilation database#530

Merged
michael-schwarz merged 1 commit intomasterfrom
compile_db_ignore_s
Jan 13, 2022
Merged

Ignore .s files (assembly) in compilation database#530
michael-schwarz merged 1 commit intomasterfrom
compile_db_ignore_s

Conversation

@michael-schwarz
Copy link
Copy Markdown
Member

cpp does not generate .i files from them, but Goblint later goes looking for them, failing because it can't find them.
Needed for goblint/bench#7

@sim642
Copy link
Copy Markdown
Member

sim642 commented Jan 13, 2022

Do you have a complete command object from a compilation database for such assembly file?

I understand that nothing meaningful for us would come out of assembly code, but I'm just surprised that whatever binary (gcc or something else?) is used to compile them accepts all the preprocessing and output arguments but doesn't actually output anything. Would've expected it to just fail at that point.

@michael-schwarz
Copy link
Copy Markdown
Member Author

 {
  "directory": "/home/michael/Documents/goblint-cil/bench-ideas/openssl",
  "arguments": [
   "gcc",
   "-fPIC",
   "-pthread",
   "-m64",
   "-Wa,--noexecstack",
   "-Wall",
   "-O3",
   "-DOPENSSL_USE_NODELETE",
   "-DL_ENDIAN",
   "-DOPENSSL_PIC",
   "-DOPENSSLDIR=\"/usr/local/ssl\"",
   "-DENGINESDIR=\"/usr/local/lib64/engines-3\"",
   "-DMODULESDIR=\"/usr/local/lib64/ossl-modules\"",
   "-DOPENSSL_BUILDING_OPENSSL",
   "-DNDEBUG",
   "-c",
   "-o",
   "crypto/ec/libcrypto-shlib-ecp_nistz256-x86_64.o",
   "crypto/ec/ecp_nistz256-x86_64.s"
  ],
  "file": "crypto/ec/ecp_nistz256-x86_64.s"
 }

@sim642
Copy link
Copy Markdown
Member

sim642 commented Jan 13, 2022

Apparently GCC does produce preprocessing output for capitalized .S, which is supposed to be preprocessed. Although being assembly we wouldn't be able to parse it anyway.

Oddly for .s with -E everything is just ignored:

Input files that don’t require compilation are ignored.

(https://gcc.gnu.org/onlinedocs/gcc/Overall-Options.html#index-E)

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