Comments (9)
Your toolchain is broken. You're mixing tools that are 18 years apart, and that never were designed to work together to start with.
I just verified that libsodium still compiles fine on an i386 Mac using Xcode (11.4.1 appears to be the last version that runs).
If you want to use a recent gcc
or clang
version, I guess you must also use matching versions of related tools such as as
, ld
, nm
, strip
, etc.
from libsodium.
@jedisct1 Toolchain is fine. The issue is that nothing checks whether instruction set is supported, but just assumes it is. It is certainly possible to implement a check, and it is just a right thing to do: it will improve the code.
P. S. Also CoreDuo itself does not support AVX, whatever tools one might install.
from libsodium.
Your gcc frontend generates code for an assembler that doesn't understand it. Your toolchain is broken.
from libsodium.
@jedisct1 How is gcc supposed to know what as
supports? (Well, if it should check but does not, then it is a bug in gcc.)
from libsodium.
I guess it doesn't, and assumes that you are using GNU as
, and a version that roughly matches what's commonly available when a gcc
version is released. Same thing for the linker, the strip
tool, etc.
from libsodium.
You can install the GNU binutils
package, and then make sure that it's before Apple tools in your PATH
. I don't know if they still support macOS/i386, though.
Really, using Xcode is the best way to have a consistent environment. I doubt a lot of people use gcc
on macOS. And by the way, libsodium
has better performance when using clang
.
from libsodium.
Well, Xcode 4.2 is the last supported on 10.6, and it is unusable with modern software.
The toolchain I have however is perfectly usable, on my PowerPC system I use exactly the same versions to build everything. If my toolchain was broken, I could not build gcc and CMake to begin with :)
I still think it is configure checks here which fail to work as supposed.
Compare against libopus
for example:
---> Configuring libopus
Executing: cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_libopus/libopus/work/opus-1.4" && ./configure --prefix=/opt/local --disable-silent-rules
checking whether make supports nested variables... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... yes
checking build system type... i386-apple-darwin10.0.0d2
checking host system type... i386-apple-darwin10.0.0d2
checking how to print strings... printf
checking whether make supports the include directive... yes (GNU style)
checking for gcc... /opt/local/bin/gcc-mp-13
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 /opt/local/bin/gcc-mp-13 accepts -g... yes
checking for /opt/local/bin/gcc-mp-13 option to accept ISO C89... none needed
checking whether /opt/local/bin/gcc-mp-13 understands -c and -o together... yes
checking dependency style of /opt/local/bin/gcc-mp-13... gcc3
checking for a sed that does not truncate output... /opt/local/bin/gsed
checking for grep that handles long lines and -e... /opt/local/bin/ggrep
checking for egrep... /opt/local/bin/ggrep -E
checking for fgrep... /opt/local/bin/ggrep -F
checking for ld used by /opt/local/bin/gcc-mp-13... /opt/local/bin/ld
checking if the linker (/opt/local/bin/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -p
checking the name lister (/usr/bin/nm -p) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 196608
checking how to convert i386-apple-darwin10.0.0d2 file names to i386-apple-darwin10.0.0d2 format... func_convert_file_noop
checking how to convert i386-apple-darwin10.0.0d2 file names to toolchain format... func_convert_file_noop
checking for /opt/local/bin/ld option to reload object files... -r
checking for objdump... no
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... no
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -p output from /opt/local/bin/gcc-mp-13 object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... yes
checking how to run the C preprocessor... /opt/local/bin/gcc-mp-13 -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if /opt/local/bin/gcc-mp-13 supports -fno-rtti -fno-exceptions... no
checking for /opt/local/bin/gcc-mp-13 option to produce PIC... -fno-common -DPIC
checking if /opt/local/bin/gcc-mp-13 PIC flag -fno-common -DPIC works... yes
checking if /opt/local/bin/gcc-mp-13 static flag -static works... no
checking if /opt/local/bin/gcc-mp-13 supports -c -o file.o... yes
checking if /opt/local/bin/gcc-mp-13 supports -c -o file.o... (cached) yes
checking whether the /opt/local/bin/gcc-mp-13 linker (/opt/local/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin10.0.0d2 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for /opt/local/bin/gcc-mp-13 option to accept ISO C99... none needed
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking dependency style of /opt/local/bin/gcc-mp-13... gcc3
checking for C/C++ restrict keyword... __restrict
checking for C99 variable-size arrays... yes
checking if compiler supports SSE intrinsics... yes
checking if compiler supports SSE2 intrinsics... yes
checking if compiler supports SSE4.1 intrinsics... no
checking if compiler supports SSE4.1 intrinsics with -msse4.1... yes
checking if compiler supports AVX intrinsics... no
checking if compiler supports AVX intrinsics with -mavx... no
configure: WARNING: Compiler does not support AVX intrinsics
checking How to get X86 CPU Info... Inline Assembly
checking for doxygen... no
checking for dot... no
checking if /opt/local/bin/gcc-mp-13 supports -fvisibility=hidden... yes
checking if /opt/local/bin/gcc-mp-13 supports -fstack-protector-strong... yes
checking whether to add -D_FORTIFY_SOURCE=2 to CFLAGS... yes
checking if /opt/local/bin/gcc-mp-13 supports -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes... yes
checking for lrintf... yes
checking for lrint... yes
checking for __malloc_hook... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating opus.pc
config.status: creating opus-uninstalled.pc
config.status: creating celt/arm/armopts.s
config.status: creating doc/Makefile
config.status: creating doc/Doxyfile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
configure:
------------------------------------------------------------------------
opus 1.4: Automatic configuration OK.
Compiler support:
C99 var arrays: ................ yes
C99 lrintf: .................... yes
Use alloca: .................... no (using var arrays)
General configuration:
Floating point support: ........ yes
Fast float approximations: ..... no
Fixed point debugging: ......... no
Inline Assembly Optimizations: . No inline ASM for your platform, please send patches
External Assembly Optimizations:
Intrinsics Optimizations: ...... x86 SSE SSE2 SSE4.1
Run-time CPU detection: ........ x86 SSE4.1
Custom modes: .................. no
Assertion checking: ............ no
Hardening: ..................... yes
Fuzzing: ....................... no
Check ASM: ..................... no
API documentation: ............. yes
Extra programs: ................ yes
------------------------------------------------------------------------
Type "make; make install" to compile and install
Type "make check" to run the test suite
It does detect lack of support for AVX (with same gcc) and builds with no errors in result. And most of ports build fine. So far I have encountered 3 related failures with just two looking identical (here and aom
).
It could be explained by a lack of testing on affected platforms, which is understandable. But now we have tested it and found that it does not work. Maybe still worth fixing?
from libsodium.
Maybe still worth fixing?
No.
from libsodium.
Maybe still worth fixing?
No.
Amazing attitude. Well, whatever.
from libsodium.
Related Issues (20)
- [Some error I got when I am implementing commitment scheme based on lib sodium] HOT 1
- AEGIS-[128,256]X HOT 2
- Cross platform decrypting
- strict-aliasing violation in blkxor pwhash_scryptsalsa208sha256_nosse.c HOT 1
- Test failing during pip install as a dependency of pynacl==1.5.0 on arm64/apple m1 image building HOT 1
- macOS randombytes_buf infinite loop HOT 14
- Chacha/box tests segfault when compiling with LLVM Polly HOT 1
- support for veilid crypto HOT 4
- aarch64 build fails after updating from 1.0.18 to 1.0.19 HOT 2
- android-ndk-r26-rc1 build error for stable HOT 6
- Why soname change from 23 to 26 HOT 1
- [UB] memcpy could be called on null dst pointer in function escrypt_r HOT 2
- Shouldn't crypto_pwdhash_PRIMITIVE be 'argon2id' ? HOT 1
- LATEST.tar.gz.sig is missing HOT 1
- Request to add amalgamation build HOT 2
- Compilation issues
- 64 bytes for the hash in `crypto_box_curve25519xsalsa20poly1305_seed_keypair(..)`? HOT 1
- Sodium.Core Nuget package version 1.3.4 is not getting installed in .Net 4.8 project HOT 1
- Support for Windows Arm64
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libsodium.