You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by GitBox <gi...@apache.org> on 2021/07/20 05:05:23 UTC
[GitHub] [trafficserver] randall edited a comment on pull request #7786: Enables cross-compiling
randall edited a comment on pull request #7786:
URL: https://github.com/apache/trafficserver/pull/7786#issuecomment-832981167
my testing consisted of cross-compiling on x86_64 macOS targeting arm64.
The environment vars I set along with the host value in testing:
```
CFLAGS='-target arm64-apple-macos'; export CFLAGS
CXXFLAGS='-target arm64-apple-macos'; export CXXFLAGS
CPPFLAGS="-target arm64-apple-macos -I/opt/arm64/include"; export CPPFLAGS
LDFLAGS="-target arm64-apple-macos -L/opt/arm64/lib"; export LDFLAGS
AM_LDFLAGS="-Xcompiler -target -Xcompiler arm64-apple-macos"; export AM_LDFLAGS
CC=clang; export CC
CXX=clang++; export CXX
./configure \
--host=x86_64-apple-darwin \
--with-openssl=/opt/arm64 \
--with-pcre=/opt/arm64
```
(I'm not saying those are required, I just tested with those).
This might've addressed some of the issues described in #7754
To test targeting arm64 macOS on x86_64 host, you'll need to build OpenSSL and PCRE (at minimum). I installed my dependencies under `/opt/arm64`
For PCRE:
```
CFLAGS='-target arm64-apple-macos'; export CFLAGS
CPPFLAGS='-target arm64-apple-macos'; export CPPFLAGS
CXXFLAGS='-target arm64-apple-macos'; export CXXFLAGS
LDFLAGS='-target arm64-apple-macos'; export LDFLAGS
CC=clang; export CC
CXX=clang++; export CXX
./configure \
--prefix=/opt/arm64 \
--host=x86_64-apple-darwin \
--disable-dependency-tracking \
--disable-silent-rules \
--disable-cpp \
--enable-shared=no
make && make install
```
For OpenSSL:
```
./Configure --prefix=/opt/arm64 darwin64-arm64-cc
make && make install
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org