-
Notifications
You must be signed in to change notification settings - Fork 168
Description
I've been playing with my team's CI, currently we cross-build windows from Ubuntu with a few exceptions running on a Windows VM. One blocker I've had is transferring aws-lc-fips.dll build from being in the windows side to the ubuntu side. There were a few approaches but i think - supporting cross compilation is the best one so far.
Clearly it is not supported atm - you have to run the .exe in order to get the correct hash via capture_hash.go.
I have a solution that doesn't require running anything, it is actually quite elegant!
Could use:
https://learn.microsoft.com/en-us/cpp/build/reference/map-generate-mapfile?view=msvc-170
This generates a mapping between symbols names to .dll file offsets as an output of the build, then you can just use this map to get the offsets of:
BORINGSSL_bcm_text_start, BORINGSSL_bcm_text_end
BORINGSSL_bcm_rodata_start, BORINGSSL_bcm_rodata_end
and calculate the hashes without ever having to run fips_empty_main against the fips dll!
The solution is both elegant and more widely supported - it will require adding .dll parsing code in inject_hash.go like other platforms do!
I was able to vibe a solution pretty quickly, i think after going over dead code i'd be able to wipe deleting more code than the newly added code - but before continuing to a pull request with a full solution i'd like to get your approval - is that a step in the right direction for you? Do you accept such pull requests at a basic level?