FreeBSD Bugzilla – Attachment 204673 Details for
Bug 237960
lang/erlang: Does not build on arm with the NATIVE option enabled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch fixing erlang build on arm by using clang80 and no NATIVE
erlang-arm-clang.diff (text/plain), 3.53 KB, created by
Bertrand Petit
on 2019-05-28 15:48:00 UTC
(
hide
)
Description:
Patch fixing erlang build on arm by using clang80 and no NATIVE
Filename:
MIME Type:
Creator:
Bertrand Petit
Created:
2019-05-28 15:48:00 UTC
Size:
3.53 KB
patch
obsolete
>diff -r ea3a1793b501 Makefile >--- a/Makefile Tue May 21 16:27:42 2019 +0200 >+++ b/Makefile Tue May 28 17:43:18 2019 +0200 >@@ -23,7 +23,6 @@ > USE_RC_SUBR= epmd > > GNU_CONFIGURE= yes >-MAKE_JOBS_UNSAFE=yes > > OPTIONS_SUB= yes > SUB_FILES= pkg-message >@@ -64,8 +63,8 @@ > OPTIONS_EXCLUDE_DragonFly= HIPE NATIVE SCTP > # ld(1) fails to link probes: missing __dtrace_erlang___* symbols > OPTIONS_EXCLUDE_aarch64= DTRACE >-OPTIONS_EXCLUDE_armv6= DTRACE >-OPTIONS_EXCLUDE_armv7= DTRACE >+OPTIONS_EXCLUDE_armv6= DTRACE SMP NATIVE >+OPTIONS_EXCLUDE_armv7= DTRACE NATIVE > OPTIONS_EXCLUDE_i386= DTRACE > > # If you run Erlang and get a message resembling "WARNING: number of >@@ -111,6 +110,15 @@ > MAKE_ARGS+= ARCH=arm > .endif > >+.if ${ARCH} == armv6 >+#CFLAGS+= -O0 >+BUILD_DEPENDS+= ${LOCALBASE}/bin/clang80:devel/llvm80 >+RUN_DEPENDS+= ${LOCALBASE}/bin/clang80:devel/llvm80 >+CONFIGURE_ENV= CC=${LOCALBASE}/bin/clang80 \ >+ CXX=${LOCALBASE}/bin/clang++80 \ >+ CPP=${LOCALBASE}/bin/clang-cpp80 >+.endif >+ > pre-configure: > @cd ${WRKSRC} && ./otp_build autoconf > >@@ -142,7 +150,7 @@ > @${ECHO_CMD} "MANPATH ${PREFIX}/lib/erlang/man" > ${WRKDIR}/erlang.conf > ${INSTALL_DATA} ${WRKDIR}/erlang.conf ${STAGEDIR}${PREFIX}/etc/man.d/erlang.conf > for SECTION in 1 3 4 6 7; do \ >- ${MKDIR} -p ${STAGEDIR}${PREFIX}/lib/erlang/man/man$${SECTION}; \ >+ ${MKDIR} ${STAGEDIR}${PREFIX}/lib/erlang/man/man$${SECTION}; \ > ${FIND} ${WRKSRC}/erts ${WRKSRC}/lib -type f | ${GREP} doc/man$${SECTION} \ > | ${XARGS} -J % ${CP} -v % ${STAGEDIR}${PREFIX}/lib/erlang/man/man$${SECTION}; \ > done >@@ -178,4 +186,12 @@ > @cd ${STAGEDIR}${PREFIX}; ${FIND} ${DOCSDIR_REL}/* -name \*.pdf \ > | ${SORT} >> ${TMPPLIST} > >+test: >+ if [ ! -e ${WRKDIR}/.tests_build_done ] ; then ERL_TOP=${WRKSRC} && \ >+ export ERL_TOP && ${MAKE_CMD} -C ${WRKSRC} tests && \ >+ touch ${WRKDIR}/.tests_build_done ; fi >+ cd ${WRKSRC}/release/tests/test_server && \ >+ ${WRKSRC}/bin/erl -noshell -s ts install -s ts run all_tests \ >+ -s init stop >+ > .include <bsd.port.post.mk> >diff -r ea3a1793b501 files/patch-erts_emulator_hipe_hipe_arm.c >--- /dev/null Thu Jan 01 00:00:00 1970 +0000 >+++ b/files/patch-erts_emulator_hipe_hipe_arm.c Tue May 28 17:43:18 2019 +0200 >@@ -0,0 +1,37 @@ >+--- erts/emulator/hipe/hipe_arm.c.orig 2019-01-08 14:39:47.000000000 +0100 >++++ erts/emulator/hipe/hipe_arm.c 2019-05-21 17:32:44.470563000 +0200 >+@@ -34,7 +34,17 @@ >+ /* Flush dcache and invalidate icache for a range of addresses. */ >+ void hipe_flush_icache_range(void *address, unsigned int nbytes) >+ { >+-#if defined(__ARM_EABI__) >++#if defined(__FreeBSD__) >++# if defined(__clang__) >++ void __clear_cache(void *start, void *end); >++ __clear_cache(address, address+nbytes); >++# elif defined(__GNUC__) >++ __builtin__clear_cache(address, address+nbytes); >++# else >++# error "compiler is not supported" >++# endif >++#else >++# if defined(__ARM_EABI__) >+ register unsigned long beg __asm__("r0") = (unsigned long)address; >+ register unsigned long end __asm__("r1") = (unsigned long)address + nbytes; >+ register unsigned long flg __asm__("r2") = 0; >+@@ -42,13 +52,14 @@ >+ __asm__ __volatile__("swi 0" /* sys_cacheflush() */ >+ : "=r"(beg) >+ : "0"(beg), "r"(end), "r"(flg), "r"(scno)); >+-#else >++# else >+ register unsigned long beg __asm__("r0") = (unsigned long)address; >+ register unsigned long end __asm__("r1") = (unsigned long)address + nbytes; >+ register unsigned long flg __asm__("r2") = 0; >+ __asm__ __volatile__("swi 0x9f0002" /* sys_cacheflush() */ >+ : "=r"(beg) >+ : "0"(beg), "r"(end), "r"(flg)); >++# endif >+ #endif >+ } >+
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 237960
:
204437
|
204438
|
204533
|
204672
| 204673
Working