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

Include x86.S file from Openwall crypt implementation #184

Merged
merged 2 commits into from
Nov 15, 2018

Conversation

tjschuck
Copy link
Collaborator

This file was left out of #182, but is only necessary to compile on 32 bit/i386 architectures (which are currently still supported for the Windows builds). Without this file, all 32 bit Windows builds are failing. This should fix that!

This is necessary to compile on 32 bit/i386 architectures (currently still supported for the Windows builds)
Ruby's mkmf generates the $objs for the Makefile by [looping over the files with SRC_EXT extensions](https://github.com/ruby/ruby/blob/9b7d8947df9780c120db7a1407bbe06e2004c511/lib/mkmf.rb#L2224-L2232), which are only [c, m, cc, mm, cxx, and cpp](https://github.com/ruby/ruby/blob/9b7d8947df9780c120db7a1407bbe06e2004c511/lib/mkmf.rb#L75-L88), not the `.S` we need here.

This instead explicitly uses the list of object files that Openwall's crypt_blowfish lists in its provided Makefile.  See it's Makefile, lines 25-29:

```c
BLOWFISH_OBJS = \
  crypt_blowfish.o x86.o

CRYPT_OBJS = \
  $(BLOWFISH_OBJS) crypt_gensalt.o wrapper.o
```

Those are what's passed to Makefile > all on line 41:

```c
all: $(CRYPT_OBJS) man
```

This just uses that list plus the name of our actual extension (the `bcrypt_ext.o` entry) to ensure that the x86.S extension gets built in.  That extension is only needed for 32-bit x86 systems, but it's fine to include on x64 as well, per the crypt_blowfish README: "you can compile and link it even on a non-x86, it will produce no code in this case".
@tjschuck tjschuck merged commit 8b800d6 into master Nov 15, 2018
@tjschuck tjschuck deleted the include_x86_openwall_dep branch November 15, 2018 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant