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

Fix compile on FreeBSD targeting ARMv6 (Raspberry Pi) #848

Merged
merged 5 commits into from Sep 14, 2018
Merged

Fix compile on FreeBSD targeting ARMv6 (Raspberry Pi) #848

merged 5 commits into from Sep 14, 2018

Conversation

@darkain
Copy link
Contributor

@darkain darkain commented Sep 13, 2018

Attempting to compile ZeroTier on FreeBSD on ARM platforms such as older Raspberry Pi units results in the following error message:

fails to link: Source object ext/arm32-neon-salsa2012-asm/salsa2012.o has EABI version 0, but target zerotier-one has EABI version 5

EABI information has been added for the assembler.

Additionally, ARMv6 doesn't support NEON, and it is optional on ARMv7. NEON support is provided by a precompiler directive, so now we check if it exists before including NEON support.

With these changes, ZeroTier compiles and runs perfectly on my Raspberry Pi Zero (using USB NIC)

@darkain darkain changed the title Fix compile on FreeBSD targeting ARMv6 Fix compile on FreeBSD targeting ARMv6 (Raspberry Pi) Sep 13, 2018
uqs pushed a commit to freebsd/freebsd-ports that referenced this pull request Sep 13, 2018
- use improved C++14 settings contributed by jbeich@
- correct LICENSE_FILES via mat@ and jbeich@
- fixes ARM build from PR#231335
- submitted by Vincent Milum <freebsd@darkain.com>
- upstream zerotier/ZeroTierOne#848

Submitted by:	Vincent Milum <freebsd@darkain.com>
Reported by:	jbeich
Approved by:	jrm (mentor)
Obtained from:	zerotier/ZeroTierOne#848
Differential Revision:	https://reviews.freebsd.org/D16880


git-svn-id: svn+ssh://svn.freebsd.org/ports/head@479671 35697150-7ecd-e111-bb59-0022644237b5
uqs pushed a commit to freebsd/freebsd-ports that referenced this pull request Sep 13, 2018
- use improved C++14 settings contributed by jbeich@
- correct LICENSE_FILES via mat@ and jbeich@
- fixes ARM build from PR#231335
- submitted by Vincent Milum <freebsd@darkain.com>
- upstream zerotier/ZeroTierOne#848

Submitted by:	Vincent Milum <freebsd@darkain.com>
Reported by:	jbeich
Approved by:	jrm (mentor)
Obtained from:	zerotier/ZeroTierOne#848
Differential Revision:	https://reviews.freebsd.org/D16880
swills pushed a commit to swills/freebsd-ports that referenced this pull request Sep 13, 2018
- use improved C++14 settings contributed by jbeich@
- correct LICENSE_FILES via mat@ and jbeich@
- fixes ARM build from PR#231335
- submitted by Vincent Milum <freebsd@darkain.com>
- upstream zerotier/ZeroTierOne#848

Submitted by:	Vincent Milum <freebsd@darkain.com>
Reported by:	jbeich
Approved by:	jrm (mentor)
Obtained from:	zerotier/ZeroTierOne#848
Differential Revision:	https://reviews.freebsd.org/D16880


git-svn-id: svn+ssh://svn.freebsd.org/ports/head@479671 35697150-7ecd-e111-bb59-0022644237b5
Jehops pushed a commit to Jehops/freebsd-ports-legacy that referenced this pull request Sep 13, 2018
- use improved C++14 settings contributed by jbeich@
- correct LICENSE_FILES via mat@ and jbeich@
- fixes ARM build from PR#231335
- submitted by Vincent Milum <freebsd@darkain.com>
- upstream zerotier/ZeroTierOne#848

Submitted by:	Vincent Milum <freebsd@darkain.com>
Reported by:	jbeich
Approved by:	jrm (mentor)
Obtained from:	zerotier/ZeroTierOne#848
Differential Revision:	https://reviews.freebsd.org/D16880


git-svn-id: svn+ssh://svn.freebsd.org/ports/head@479671 35697150-7ecd-e111-bb59-0022644237b5
@dch
Copy link
Contributor

@dch dch commented Sep 14, 2018

@darkain awesome, that compiles on armv6 but I can't get this to build on armv7 (only available in 12.0-CURRENT, but still)... I've tried sprinkling -fPIC and still get issues. Any suggestions for what needs changing?

clang++ -O2 -pipe -flax-vector-conversions -fno-strict-aliasing  -O2 -pipe  -flax-vector-conversions -fno-strict-aliasing -Wall -fPIE -fvisibility=hidden -fstack-protector -pthread  -DNDEBUG  -DZT_NO_TYPE_PUNNING -DZT_USE_ARM32_NEON_ASM_SALSA2012 -DZT_BUILD_PLATFORM=7 -DZT_BUILD_ARCHITECTURE=3 -DZT_SOFTWARE_UPDATE_DEFAULT="\"disable\"" -fno-rtti -std=c++11  -O2 -pipe  -flax-vector-conversions -fno-strict-aliasing -Wall -fPIE -fvisibility=hidden -fstack-protector -pthread  -DNDEBUG  -DZT_NO_TYPE_PUNNING -DZT_USE_ARM32_NEON_ASM_SALSA2012 -DZT_BUILD_PLATFORM=7 -DZT_BUILD_ARCHITECTURE=3 -DZT_SOFTWARE_UPDATE_DEFAULT="\"disable\"" -Wall -Werror -g -pthread   -DZT_TRACE -DZT_NO_TYPE_PUNNING -DZT_USE_ARM32_NEON_ASM_SALSA2012 -DZT_BUILD_PLATFORM=7 -DZT_BUILD_ARCHITECTURE=3 -DZT_SOFTWARE_UPDATE_DEFAULT="\"disable\"" -fno-rtti -std=c++11   -pie -Wl,-z,relro,-z,now  -o zerotier-one node/C25519.o node/Capability.o node/CertificateOfMembership.o node/CertificateOfOwnership.o node/Identity.o node/IncomingPacket.o node/InetAddress.o node/Membership.o node/Multicaster.o node/Network.o node/NetworkConfig.o node/Node.o node/OutboundMulticast.o node/Packet.o node/Path.o node/Peer.o node/Poly1305.o node/Revocation.o node/Salsa20.o node/SelfAwareness.o node/SHA512.o node/Switch.o node/Tag.o node/Topology.o node/Trace.o node/Utils.o ext/arm32-neon-salsa2012-asm/salsa2012.o controller/EmbeddedNetworkController.o controller/DB.o controller/FileDB.o controller/RethinkDB.o osdep/ManagedRoute.o osdep/Http.o osdep/OSUtils.o service/SoftwareUpdater.o service/OneService.o osdep/BSDEthernetTap.o ext/http-parser/http_parser.o one.o 
/usr/bin/ld: error: can't create dynamic relocation R_ARM_ABS32 against local symbol in readonly segment; recompile object files with -fPIC
>>> defined in ext/arm32-neon-salsa2012-asm/salsa2012.o
>>> referenced by ext/arm32-neon-salsa2012-asm/salsa2012.o:(.text+0x630)
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[2]: *** [make-bsd.mk:136: one] Error 1
gmake[2]: Leaving directory '/tmp/usr/ports/net/zerotier/work/ZeroTierOne-1.2.12'
gmake[1]: *** [make-bsd.mk:163: debug] Error 2
gmake[1]: Leaving directory '/tmp/usr/ports/net/zerotier/work/ZeroTierOne-1.2.12'
*** Error code 1
@adamierymenko adamierymenko changed the base branch from master to dev Sep 14, 2018
@adamierymenko adamierymenko merged commit ef48d11 into zerotier:dev Sep 14, 2018
@adamierymenko
Copy link
Contributor

@adamierymenko adamierymenko commented Sep 14, 2018

Merged into dev since that's where we do work. Merge looks great, but you might want to pull dev and test. We don't have an ARM/FreeBSD box handy.

@darkain
Copy link
Contributor Author

@darkain darkain commented Sep 14, 2018

@dch I currently only have physical boards for ARMv6, nothing for ARMv7. It might be best currently to entirely omit NEON support from the FreeBSD port for the time being.

Over my free time this weekend, I'll try messing around with QEMU to see if I can get this to build and run on virtual ARM units, but I know those don't perfectly match real-world hardware.

@darkain
Copy link
Contributor Author

@darkain darkain commented Sep 14, 2018

WALP, screw it. Amazon Prime free same-day shipping. I'll have a Pi 3B+ tonight to test both ARMv7 and ARMv8 builds on.

freqlabs added a commit to truenas/ports that referenced this pull request Feb 28, 2019
- use improved C++14 settings contributed by jbeich@
- correct LICENSE_FILES via mat@ and jbeich@
- fixes ARM build from PR#231335
- submitted by Vincent Milum <freebsd@darkain.com>
- upstream zerotier/ZeroTierOne#848

Submitted by:	Vincent Milum <freebsd@darkain.com>
Reported by:	jbeich
Approved by:	jrm (mentor)
Obtained from:	zerotier/ZeroTierOne#848
Differential Revision:	https://reviews.freebsd.org/D16880
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants