Linuxbrew-core: openssl on arm64 fails to build after mis-recognizing the architecture

Created on 25 Jan 2019  路  17Comments  路  Source: Homebrew/linuxbrew-core

Please note we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again.

  • [x] have a problem with brew install (or upgrade, reinstall) a single formula? If it's a general brew problem please file this issue at Linuxbrew/brew: https://github.com/Linuxbrew/brew/issues/new/choose. If it's a tap (e.g. Brewsci/homebrew-bio) problem please file this issue at the tap.
  • [x] ran brew update and can still reproduce the problem?
  • [ ] ran brew doctor, fixed all issues and can still reproduce the problem?
  • [ ] ran brew gist-logs <formula> (where <formula> is the name of the formula that failed) and included the output link?
  • [x] if brew gist-logs didn't work: ran brew config and brew doctor and included their output with your issue?
emv@dfw-xda:~$ brew config
HOMEBREW_VERSION: 1.9.3-10-g40bfc39
ORIGIN: https://github.com/Homebrew/brew
HEAD: 40bfc39912f9abe5acea4e1950bc1951bccc380e
Last commit: 23 hours ago
Core tap ORIGIN: https://github.com/Linuxbrew/homebrew-core
Core tap HEAD: c64c242ba62a242c808f98bdf0643b603555c8f9
Core tap last commit: 13 hours ago
HOMEBREW_PREFIX: /home/emv/.linuxbrew
HOMEBREW_REPOSITORY: /home/emv/.linuxbrew/Homebrew
HOMEBREW_CELLAR: /home/emv/.linuxbrew/Cellar
HOMEBREW_CACHE: /home/emv/.cache/Homebrew
HOMEBREW_LOGS: /home/emv/.cache/Homebrew/Logs
HOMEBREW_NO_ANALYTICS_THIS_RUN: 1
Homebrew Ruby: 2.5.1 => /usr/bin/ruby2.5
Clang: N/A
Git: 2.17.1 => /usr/bin/git
Curl: 7.58.0 => /usr/bin/curl
Kernel: Linux 4.15.0-34-generic aarch64 GNU/Linux
OS: Ubuntu 18.04.1 LTS (bionic)
Host glibc: 2.27
/usr/bin/gcc: 7.3.0
glibc: N/A
gcc: N/A
xorg: N/A
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Your Homebrew's prefix is not /home/linuxbrew/.linuxbrew.
Some of Homebrew's bottles (binary packages) can only be used with the default
prefix (/home/linuxbrew/.linuxbrew).
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew's GitHub,
Discourse, Twitter or IRC. You are responsible for resolving any issues you
experience, as you are running this unsupported configuration.

To help us debug your issue please explain:

  • What you were trying to do (and why)

build openssl on arm64.

  • What happened (include command output)
==> make
Last 15 lines from /home/emv/.cache/Homebrew/Logs/openssl/03.make:
x86_64cpuid.s:251: Error: unknown mnemonic `movl' -- `movl $8,%ecx'
x86_64cpuid.s:254: Error: unknown mnemonic `jc' -- `jc .Lbreak_rdrand'
x86_64cpuid.s:255: Error: unknown mnemonic `loop' -- `loop .Loop_rdrand'
x86_64cpuid.s:257: Error: unknown mnemonic `cmpq' -- `cmpq $0,%rax'
x86_64cpuid.s:258: Error: unknown mnemonic `cmoveq' -- `cmoveq %rcx,%rax'
x86_64cpuid.s:266: Error: unknown mnemonic `movl' -- `movl $8,%ecx'
x86_64cpuid.s:269: Error: unknown mnemonic `jc' -- `jc .Lbreak_rdseed'
x86_64cpuid.s:270: Error: unknown mnemonic `loop' -- `loop .Loop_rdseed'
x86_64cpuid.s:272: Error: unknown mnemonic `cmpq' -- `cmpq $0,%rax'
x86_64cpuid.s:273: Error: unknown mnemonic `cmoveq' -- `cmoveq %rcx,%rax'
<builtin>: recipe for target 'x86_64cpuid.o' failed
make[1]: *** [x86_64cpuid.o] Error 1
make[1]: Leaving directory '/tmp/openssl-20190125-14233-1i8nmlo/openssl-1.0.2q/crypto'
Makefile:287: recipe for target 'build_crypto' failed
  • What you expected to happen

build succeeded

  • Step-by-step reproduction instructions (by running brew install commands)

brew install openssl

note: at https://github.com/Linuxbrew/homebrew-core/blob/631ec00bc4a4772d38c9077bed42afee69cd12c8/Formula/openssl.rb#L39-L48 the arch_args formula never selects arm64 or aarch64 as the correct architecture.

outdated question

All 17 comments

Looking at #11066 I'll flag @iMichka here - I am not quite familiar enough to submit a patch myself, though it should be something fairly straightforward.

Hi. What happened is the following: upstream dropped support for 32 bit, and cleaned up some flags. The merged from homebrew-core to this repository was quite a mess. So now the formula only has flags for x86_64.
We need to add flags back for the other archs on Linux.

Please note that arm is somewhat supported here, but only on a case by case basis. I do not have the resources (e.g. much time) to work on fixes for these. But pull requests are welcome.

Gotcha! I'm particularly interested in arm64 (64-bit) and would be happy to also provide hardware and support for same through @worksonarm . Mostly I'm interested in recruiting someone to the project who does have the time and the specific interest in arm64 to be point on this.

We have 2 strategies here:

  • either the patches go in this repo
  • either you fork this repo and manage the patches there (under an ARMBrew org or something equivalent).

The second option has the advantage that you could plan on having bottles (precompiled binaries), and I think it is the one I prefer. I would like to see a proof of concept with the main 100 to 200 formulae working before considering adding anything here. We are already struggling to keep the amd64 stuff up and running. @sjackman may have some thoughts on that too.

I am willing to add some smaller patches in this repo to get you going if you want, but it should stay a limited amount for the time being.

My preference is for the ARM64 support to go in this repo, particularly if Edward (@vielmetti) recruits someone to maintain that work. I don't want that maintenance burden to fall on your shoulders, Michka. My guess/hope is that relatively few formulae should requiring patching specifically for ARM. Edward, do you have someone in mind to maintain ARM64 for Linuxbrew/core?

I am ok for patches. It is more about the CI. We need a rock-solid CI for ARM if we want to build bottles. Our current CI setup needs a lot of manual intervention and rebuilds/reuploads, which makes it hard to use. I do not want to have 2 CIs to babysit :)

I do not want to have 2 CIs to babysit :)

They're way worse than toddlers. 馃懚

@vielmetti Would you like to run CI (automated testing) for ARM64?
Would you like to build precompiled binary packages (called bottles) for ARM64?

I'm thinking CI and bottles for ARM64 could be future aims for Linuxbrew on ARM64, and for now we merge the ARM64 patches that are needed directly into Linuxbrew/core.

So perhaps several separate issues.

I think the arm64-related patches here are going to be small, at least the first go around. Before I say that, though, I'm going to make a run through trying to build everything. I have a fast parallel multicore machine to do that on, but I haven't figured out yet how to use all the cores at once, since brew complains if you build one thing while another thing is being built.

My goal with an initial build world is to get a baseline. How many things work and how many don't? What if any packages install x86 binaries so that they look like they work but really don't? Are there common dependencies to tackle first (and I'm pretty sure openssl is very high on that list)?

I'd like to eventually do CI, and for that I'd propose to use Drone Cloud (@drone), which runs here on Packet equipment and supports all of x86, 32-bit Arm, and arm64. But that could be a future aim, since it's likely to involve a bit of setup work. It would also be great to have bottles, but again, that can be a future target.

@sjackman I do have someone I'm thinking of, yes - they are not under contract to do this work, though, so I'll hold off on committing them to it until I do some research first to assess the scope of work.

OK, my build world step is cranking away, one package at a time.

It looks so far like openssl, go, and libpng have multiple attempts to build and resulting failures.

13 packages have the message configure: error: cannot guess build type; you must specify one or a variant.

I would recommend to focus on packages that already have a Linux bottle. There are around 1900 packages with bottles, out of 4000 to 5000 formulae. I do not guarantee that all the 1900 are building fine, but at least we worked at least once on them and there was at least one successful build for them.

I can provide you the top 200 formulae with the most installs. I think it would be good to start with these, to get a good basis to build on. I can export that data later when I am back from work.

Before I say that, though, I'm going to make a run through trying to build everything.

馃槷

I have a fast parallel multicore machine to do that on, but I haven't figured out yet how to use all the cores at once, since brew complains if you build one thing while another thing is being built.

Most formulae use make -j by default (unless it's disabled due to known failures), so building one formula at a time is fine.

I agree with Michka, building formulae in order of popularity and formulae with x86_64 bottles is a good start. See https://brew.sh/analytics/install-on-request/

Here is the list with the nbr of installs for the top 200, since November 1, 2018:

formula | nbr of installs
-- | --
patchelf | 19946
openssl | 17791
zlib | 14575
sqlite | 14357
ncurses | 14093
readline | 13391
gdbm | 13330
python | 13242
bzip2 | 12459
node | 11097
gcc | 10500
python@2 | 10303
git | 9094
xz | 8688
pkg-config | 8673
hello | 8468
libffi | 8369
expat | 8287
libbsd | 7919
gmp | 7369
gettext | 6972
curl | 6652
icu4c | 6593
mpfr | 6240
libmpc | 6168
jq | 6150
[email protected] | 5968
cmake | 5708
perl | 5657
bash | 5500
go | 5299
berkeley-db | 4943
m4 | 4768
autoconf | 4638
ruby | 4488
libxml2 | 4476
pcre | 4304
libtool | 4295
pcre2 | 4265
util-linux | 4002
make | 3982
libyaml | 3910
pyenv | 3849
libpng | 3763
unzip | 3595
pipenv | 3498
oniguruma | 3129
awscli | 2969
coreutils | 2881
gnu-sed | 2813
linuxbrew/xorg/xorgproto | 2768
libtiff | 2682
freetype | 2616
automake | 2613
vim | 2483
rsync | 2455
jpeg | 2406
gpatch | 2387
linuxbrew/xorg/libx11 | 2348
binutils | 2333
boost | 2318
linuxbrew/xorg/libpthread-stubs | 2311
linuxbrew/xorg/libxcb | 2300
fontconfig | 2291
glib | 2267
findutils | 2224
gzip | 2200
grep | 2197
libxslt | 2134
diffutils | 2133
linuxbrew/xorg/libxau | 2129
linuxbrew/xorg/libxdmcp | 2126
gnu-which | 2118
gnu-time | 2110
linuxbrew/xorg/libxext | 2095
awslogs | 2068
linuxbrew/xorg/libxrender | 2061
fzf | 1919
linuxbrew/xorg/libxinerama | 1889
neovim | 1881
gnu-tar | 1874
linuxbrew/xorg/libice | 1797
linuxbrew/xorg/libxscrnsaver | 1785
linuxbrew/xorg/libxcursor | 1743
yarn | 1741
webp | 1721
gperf | 1706
linuxbrew/xorg/libxfixes | 1706
linuxbrew/xorg/libxxf86vm | 1685
glibc | 1645
rust | 1641
wget | 1617
linuxbrew/xorg/libxv | 1613
libuv | 1579
linuxbrew/xorg/libxrandr | 1572
zsh | 1570
linuxbrew/xorg/libxi | 1563
youtube-dl | 1534
libunistring | 1532
bison | 1521
tmux | 1504
mkcert | 1498
sphinx-doc | 1463
lua | 1426
libcap | 1399
linuxbrew/xorg/xtrans | 1384
linuxbrew/xorg/libxt | 1380
watchman | 1364
libedit | 1351
json-c | 1336
linuxbrew/xorg/libpciaccess | 1316
linuxbrew/xorg/libxshmfence | 1312
imagemagick | 1296
libevent | 1295
bdw-gc | 1273
postgresql | 1265
linuxbrew/xorg/libsm | 1260
linuxbrew/xorg/libxaw3d | 1248
linuxbrew/xorg/libxfont | 1238
linuxbrew/xorg/libxdamage | 1211
linuxbrew/xorg/libxres | 1210
linuxbrew/xorg/libdmx | 1207
cairo | 1202
mysql | 1194
linuxbrew/xorg/libxvmc | 1193
linuxbrew/xorg/xorg | 1151
docker | 1150
pixman | 1141
linuxbrew/xorg/libfs | 1138
systemd | 1129
source-highlight | 1117
linuxbrew/xorg/libxpm | 1113
linuxbrew/xorg/libxmu | 1108
linuxbrew/xorg/libxaw | 1107
linuxbrew/xorg/libxcomposite | 1094
nvm | 1093
pulseaudio | 1085
linuxbrew/xorg/xdpyinfo | 1084
harfbuzz | 1082
mongodb | 1081
linuxbrew/xorg/libfontenc | 1080
linuxbrew/xorg/libxft | 1076
linuxbrew/xorg/libxtst | 1075
linuxbrew/xorg/libxxf86dga | 1069
linuxbrew/xorg/libxkbfile | 1066
libogg | 1040
libvorbis | 1031
gradle | 1025
guile | 1025
rbenv | 1017
msgpack | 1009
gnutls | 982
nettle | 981
ruby-build | 967
flac | 961
autogen | 949
sonar-scanner | 905
ffmpeg | 900
libtasn1 | 899
libsndfile | 884
aws/tap/aws-sam-cli | 875
libidn2 | 867
redis | 866
jdk | 865
hub | 861
p11-kit | 858
maven | 849
openblas | 849
jemalloc | 846
libsoxr | 840
speexdsp | 833
texinfo | 833
protobuf | 829
xmrig | 826
ripgrep | 822
kubernetes-cli | 811
graphite2 | 808
swig | 808
little-cms2 | 802
kubernetes-helm | 784
bat | 779
openjpeg | 761
tree | 760
sdl2 | 757
docker-compose | 754
libssh2 | 748
git-credential-manager | 739
libgpg-error | 738
libvpx | 736
llvm | 717
isl | 713
docbook | 710
libelf | 702
docbook-xsl | 701
opus | 692
fish | 676
linux-headers | 675
fribidi | 666
graphviz | 666
snappy | 662
linuxbrew/xorg/xinput | 658
numpy | 647
openjdk | 647
lame | 646
nasm | 645
x265 | 645
yasm | 645
flex | 638
x264 | 631
php | 626
valgrind | 622
open-mpi | 621
tbb | 616
libvterm | 611
pango | 610
luajit | 608
terraform | 602
[email protected] | 586
libtermkey | 579
linuxbrew/xorg/util-macros | 577
theora | 576
unibilium | 573
hugo | 570
llvm@4 | 552
htop | 549
gdk-pixbuf | 543
httpie | 543
libpq | 543
the_silver_searcher | 543
libgcrypt | 537
gobject-introspection | 531
gtk-doc | 526
parallel | 522
libzip | 517
gcc@6 | 516
fd | 514
xvid | 509
mercurial | 505
qt | 505
apr-util | 502
blast | 497
emacs | 496
apr | 488
zsh-completions | 488
bash-completion | 478
tig | 460
freetds | 455
linuxbrew/xorg/libdrm | 451
linuxbrew/xorg/libva | 449
gd | 448

As this is more a question/request than a real issue, I propose that any discussion should continue on https://discourse.brew.sh/c/linuxbrew.

I'm closing this issue as there is not action to be taken on our side for the time being.

@vielmetti You can also open a PR to address this build failure, and we can resume the discussion there.

Was this page helpful?
0 / 5 - 0 ratings