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

Fails build on MacOS 10.15.4 #28

Closed
klibansky opened this issue Apr 23, 2020 · 9 comments
Closed

Fails build on MacOS 10.15.4 #28

klibansky opened this issue Apr 23, 2020 · 9 comments

Comments

@klibansky
Copy link

When following the build process on my mac it stops on an error:

configure: error: could not determine ar interface

Full output here:

+ pushd uv
~/hnsd/uv ~/hnsd
+ test -f configure
+ ./autogen.sh
+ glibtoolize --copy
glibtoolize: putting auxiliary files in '.'.
glibtoolize: copying file './ltmain.sh'
glibtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
glibtoolize: copying file 'm4/libtool.m4'
glibtoolize: copying file 'm4/ltoptions.m4'
glibtoolize: copying file 'm4/ltsugar.m4'
glibtoolize: copying file 'm4/ltversion.m4'
glibtoolize: copying file 'm4/lt~obsolete.m4'
+ aclocal -I m4
+ autoconf
+ automake --add-missing --copy
configure.ac:38: installing './ar-lib'
configure.ac:25: installing './compile'
configure.ac:22: installing './config.guess'
configure.ac:22: installing './config.sub'
configure.ac:21: installing './install-sh'
configure.ac:21: installing './missing'
Makefile.am: installing './depcomp'
+ popd
~/hnsd
+ glibtoolize --copy
glibtoolize: putting auxiliary files in '.'.
glibtoolize: copying file './ltmain.sh'
glibtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
glibtoolize: copying file 'm4/libtool.m4'
glibtoolize: copying file 'm4/ltoptions.m4'
glibtoolize: copying file 'm4/ltsugar.m4'
glibtoolize: copying file 'm4/ltversion.m4'
glibtoolize: copying file 'm4/lt~obsolete.m4'
+ aclocal -I m4
+ autoconf
+ automake --add-missing --copy
configure.ac:12: installing './ar-lib'
configure.ac:10: installing './compile'
configure.ac:6: installing './config.guess'
configure.ac:6: installing './config.sub'
configure.ac:4: installing './install-sh'
configure.ac:4: installing './missing'
Makefile.am: installing './depcomp'
checking for a BSD-compatible install... /usr/local/bin/ginstall -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -p
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking build system type... x86_64-apple-darwin19.4.0
checking host system type... x86_64-apple-darwin19.4.0
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of g++... gcc3
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for ar... ar
checking the archiver (ar) interface... unknown
configure: error: could not determine ar interface
@pinheadmz
Copy link
Member

There have been many updates to hnsd, could you give it another try from master branch?

@faddat
Copy link
Contributor

faddat commented Nov 9, 2020

I'm on master branch, and here's what I get when following the Readme:

(CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh /Users/faddat/hnsd/missing autoheader)
rm -f src/stamp-h1
touch src/config.h.in
cd . && /bin/sh ./config.status src/config.h
config.status: creating src/config.h
config.status: src/config.h is unchanged
  CC       src/libhsk_la-ec.lo
src/ec.c:237:8: error: implicit declaration of function 'hsk_secp256k1_ec_pubkey_to_hash' is invalid
      in C99 [-Werror,-Wimplicit-function-declaration]
  if (!hsk_secp256k1_ec_pubkey_to_hash(ec, result, &pub, entropy))
       ^
src/ec.c:253:8: error: implicit declaration of function 'hsk_secp256k1_ec_pubkey_from_hash' is
      invalid in C99 [-Werror,-Wimplicit-function-declaration]
  if (!hsk_secp256k1_ec_pubkey_from_hash(ec, &pub, hash))
       ^
2 errors generated.
make[1]: *** [src/libhsk_la-ec.lo] Error 1
make: *** [all-recursive] Error 1

@faddat
Copy link
Contributor

faddat commented Nov 9, 2020

I will try making a github action for mac. This way if the build breaks, we know it.

Also give us a standard to test against.

@pinheadmz
Copy link
Member

Hm, builds fine on my OSX system. What compiler / version are you running?
This is mine:

--> gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple clang version 11.0.0 (clang-1100.0.33.8)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

@faddat
Copy link
Contributor

faddat commented Nov 10, 2020

interesting!

Here's my infodump for you:

gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.21)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Wonder if I can get earlier-clang on here, as well.

@pinheadmz
Copy link
Member

Hm well either way this implicit declaration was introduced in #30
I'm not sure why it throws an error though, the functions are declared in ec.h
I wonder if they just need to be declared higher up in the ec.h file?

@faddat
Copy link
Contributor

faddat commented Nov 10, 2020

I think, but cannot say for sure due to inexperience with C that this boils down to an issue with build flags:

-Werror,-Wimplicit-function-declaration

-Werror makes warnings into errors
-Wimplicit-function-declaration warns when there is an implicit function declared, so we get kaboom.

@faddat faddat mentioned this issue Nov 12, 2020
@faddat
Copy link
Contributor

faddat commented Nov 13, 2020

hnsd/src/ec.h

Line 19 in 462220f

I moved the declarations to this line, but no luck. Probably just need to disable -Wimplicit-function-declaration

Went higher, too, but no luck. Is it possible there's another header file that we need to have in ec.h?

https://gotopstudy.com/implicit-declaration-of-function-c-solved/

I feel accomplished. Seems it is fixed now. PR incoming.

Needed to import elligator.h and then smooth as butter.

@pinheadmz
Copy link
Member

closed by #48

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

No branches or pull requests

3 participants