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

Invalid record size with clang 14.0.0 #201

Closed
ramsdell opened this issue Jan 10, 2023 · 1 comment
Closed

Invalid record size with clang 14.0.0 #201

ramsdell opened this issue Jan 10, 2023 · 1 comment

Comments

@ramsdell
Copy link

I know 14.0 is not supported yet, but here is some more info to debug problems.

% saw --version
saw --version
0.9.0.99 (727fccb4)
% cc --version
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: x86_64-apple-darwin21.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
% cat gf16.c
#include <stdint.h>

// gf4 := gf2[x]/x^2+x+1
uint8_t gf4_mul_2(uint8_t a) {
  uint8_t r = a << 1;
  r ^= (a >> 1) * 7;
  return r;
}
% cat gf16.saw 
m <- llvm_load_module "gf16.bc";
% make
clang -g -c -emit-llvm -o gf16.bc gf16.c
saw gf16.saw



[20:04:46.119] Loading file "/Users/ramsdell/rep/nsapq/src/tmp/gf16.saw"
[20:04:46.123] Stack trace:
"llvm_load_module" (/Users/ramsdell/rep/nsapq/src/tmp/gf16.saw:1:6-1:22)
Invalid record size: 15
Expected size between 12 and 13
Are you sure you're using a supported version of LLVM/Clang?
Check here: https://github.com/GaloisInc/llvm-pretty-bc-parser

from:
	METADATA_DERIVED_TYPE
	METADATA_BLOCK
	@gf4_mul_2
	FUNCTION_BLOCK
	FUNCTION_BLOCK_ID
	value symbol table
	MODULE_BLOCK
	Bitstream


make: *** [all] Error 2
% 
@RyanGlScott
Copy link
Contributor

I suspect that this is a symptom of #188.

RyanGlScott added a commit that referenced this issue Apr 7, 2023
RyanGlScott added a commit that referenced this issue Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants