* [Buildroot] [PATCH 1/1] package/erlang: fix -fno-common build failure
@ 2020-05-17 21:34 Heiko Thiery
2020-05-27 20:27 ` Yann E. MORIN
2020-06-01 20:15 ` Peter Korsgaard
0 siblings, 2 replies; 3+ messages in thread
From: Heiko Thiery @ 2020-05-17 21:34 UTC (permalink / raw)
To: buildroot
Added upstream patch for fixing build failure when using GCC10 as a host
compiler (-fno-common is now default).
Cc: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
---
...d-ODR-violation-of-ei_default_socket.patch | 54 +++++++++++++++++++
1 file changed, 54 insertions(+)
create mode 100644 package/erlang/0003-ei_portio.h-avoid-ODR-violation-of-ei_default_socket.patch
diff --git a/package/erlang/0003-ei_portio.h-avoid-ODR-violation-of-ei_default_socket.patch b/package/erlang/0003-ei_portio.h-avoid-ODR-violation-of-ei_default_socket.patch
new file mode 100644
index 0000000000..69b6fae81f
--- /dev/null
+++ b/package/erlang/0003-ei_portio.h-avoid-ODR-violation-of-ei_default_socket.patch
@@ -0,0 +1,54 @@
+From de870d7f9f36b3e68f280057851a4585a67ab219 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Tue, 14 Jan 2020 23:15:01 +0000
+Subject: [PATCH] ei_portio.h: avoid ODR violation of
+ 'ei_default_socket_callbacks'
+
+Noticed as a build failure against fresh gcc-master:
+
+```
+LD otp/lib/erl_interface/bin/x86_64-unknown-linux-gnu/erl_call
+ld: otp/lib/erl_interface/obj/x86_64-unknown-linux-gnu/libei.a(eirecv.o):otp/lib/erl_interface/src/misc/ei_portio.h:50: multiple definition of `ei_default_socket_callbacks'; otp/lib/erl_interface/obj/x86_64-unknown-linux-gnu/libei.a(ei_connect.o):otp/lib/erl_interface/src/misc/ei_portio.h:50: first defined here
+ld: otp/lib/erl_interface/obj/x86_64-unknown-linux-gnu/libei.a(send.o):otp/lib/erl_interface/src/misc/ei_portio.h:50: multiple definition of `ei_default_socket_callbacks'; otp/lib/erl_interface/obj/x86_64-unknown-linux-gnu/libei.a(ei_connect.o):otp/lib/erl_interface/src/misc/ei_portio.h:50: first defined here
+ld: otp/lib/erl_interface/obj/x86_64-unknown-linux-gnu/libei.a(send_reg.o):otp/lib/erl_interface/src/misc/ei_portio.h:50: multiple definition of `ei_default_socket_callbacks'; otp/lib/erl_interface/obj/x86_64-unknown-linux-gnu/libei.a(ei_connect.o):otp/lib/erl_interface/src/misc/ei_portio.h:50: first defined here
+ld: otp/lib/erl_interface/obj/x86_64-unknown-linux-gnu/libei.a(epmd_port.o):otp/lib/erl_interface/src/misc/ei_portio.h:50: multiple definition of `ei_default_socket_callbacks'; otp/lib/erl_interface/obj/x86_64-unknown-linux-gnu/libei.a(ei_connect.o):otp/lib/erl_interface/src/misc/ei_portio.h:50: first defined here
+ld: otp/lib/erl_interface/obj/x86_64-unknown-linux-gnu/libei.a(ei_portio.o):otp/lib/erl_interface/src/misc/ei_portio.h:50: multiple definition of `ei_default_socket_callbacks'; otp/lib/erl_interface/obj/x86_64-unknown-linux-gnu/libei.a(ei_connect.o):otp/lib/erl_interface/src/misc/ei_portio.h:50: first defined here
+collect2: error: ld returned 1 exit status
+make[3]: *** [x86_64-unknown-linux-gnu/Makefile:669: otp/lib/erl_interface/bin/x86_64-unknown-linux-gnu/erl_call] Error 1
+```
+
+The failure looks legitimate: `ei_default_socket_callbacks` is a
+struct defined in 'ei_portio.h' and in 'ei_portio.c'.
+
+The change flips 'ei_portio.h' definition to declaration.
+
+gcc-10 will change the default from -fcommon to fno-common:
+https://gcc.gnu.org/PR85678.
+
+The error also happens if CFLAGS=-fno-common passed explicitly.
+
+Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
+
+Patch taken from upstream: https://github.com/erlang/otp/commit/de870d7f9f36b3e68f280057851a4585a67ab219
+Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
+---
+ lib/erl_interface/src/misc/ei_portio.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/erl_interface/src/misc/ei_portio.h b/lib/erl_interface/src/misc/ei_portio.h
+index 84ebc5039a..5172d085b4 100644
+
+--- a/lib/erl_interface/src/misc/ei_portio.h
++++ b/lib/erl_interface/src/misc/ei_portio.h
+@@ -47,7 +47,7 @@ int ei_writev_fill_ctx_t__(ei_socket_callbacks *cbs, void *ctx, const struct iov
+ int ei_socket_callbacks_have_writev__(ei_socket_callbacks *cbs);
+ #endif
+
+-ei_socket_callbacks ei_default_socket_callbacks;
++extern ei_socket_callbacks ei_default_socket_callbacks;
+
+ #define EI_FD_AS_CTX__(FD) \
+ ((void *) (long) (FD))
+--
+2.20.1
+
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH 1/1] package/erlang: fix -fno-common build failure
2020-05-17 21:34 [Buildroot] [PATCH 1/1] package/erlang: fix -fno-common build failure Heiko Thiery
@ 2020-05-27 20:27 ` Yann E. MORIN
2020-06-01 20:15 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Yann E. MORIN @ 2020-05-27 20:27 UTC (permalink / raw)
To: buildroot
Heiko, All,
On 2020-05-17 23:34 +0200, Heiko Thiery spake thusly:
> Added upstream patch for fixing build failure when using GCC10 as a host
> compiler (-fno-common is now default).
>
> Cc: Romain Naour <romain.naour@gmail.com>
> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
Applied to master, thanks.
Regards,
Yann E. MORIN.
> ---
> ...d-ODR-violation-of-ei_default_socket.patch | 54 +++++++++++++++++++
> 1 file changed, 54 insertions(+)
> create mode 100644 package/erlang/0003-ei_portio.h-avoid-ODR-violation-of-ei_default_socket.patch
>
> diff --git a/package/erlang/0003-ei_portio.h-avoid-ODR-violation-of-ei_default_socket.patch b/package/erlang/0003-ei_portio.h-avoid-ODR-violation-of-ei_default_socket.patch
> new file mode 100644
> index 0000000000..69b6fae81f
> --- /dev/null
> +++ b/package/erlang/0003-ei_portio.h-avoid-ODR-violation-of-ei_default_socket.patch
> @@ -0,0 +1,54 @@
> +From de870d7f9f36b3e68f280057851a4585a67ab219 Mon Sep 17 00:00:00 2001
> +From: Sergei Trofimovich <slyfox@gentoo.org>
> +Date: Tue, 14 Jan 2020 23:15:01 +0000
> +Subject: [PATCH] ei_portio.h: avoid ODR violation of
> + 'ei_default_socket_callbacks'
> +
> +Noticed as a build failure against fresh gcc-master:
> +
> +```
> +LD otp/lib/erl_interface/bin/x86_64-unknown-linux-gnu/erl_call
> +ld: otp/lib/erl_interface/obj/x86_64-unknown-linux-gnu/libei.a(eirecv.o):otp/lib/erl_interface/src/misc/ei_portio.h:50: multiple definition of `ei_default_socket_callbacks'; otp/lib/erl_interface/obj/x86_64-unknown-linux-gnu/libei.a(ei_connect.o):otp/lib/erl_interface/src/misc/ei_portio.h:50: first defined here
> +ld: otp/lib/erl_interface/obj/x86_64-unknown-linux-gnu/libei.a(send.o):otp/lib/erl_interface/src/misc/ei_portio.h:50: multiple definition of `ei_default_socket_callbacks'; otp/lib/erl_interface/obj/x86_64-unknown-linux-gnu/libei.a(ei_connect.o):otp/lib/erl_interface/src/misc/ei_portio.h:50: first defined here
> +ld: otp/lib/erl_interface/obj/x86_64-unknown-linux-gnu/libei.a(send_reg.o):otp/lib/erl_interface/src/misc/ei_portio.h:50: multiple definition of `ei_default_socket_callbacks'; otp/lib/erl_interface/obj/x86_64-unknown-linux-gnu/libei.a(ei_connect.o):otp/lib/erl_interface/src/misc/ei_portio.h:50: first defined here
> +ld: otp/lib/erl_interface/obj/x86_64-unknown-linux-gnu/libei.a(epmd_port.o):otp/lib/erl_interface/src/misc/ei_portio.h:50: multiple definition of `ei_default_socket_callbacks'; otp/lib/erl_interface/obj/x86_64-unknown-linux-gnu/libei.a(ei_connect.o):otp/lib/erl_interface/src/misc/ei_portio.h:50: first defined here
> +ld: otp/lib/erl_interface/obj/x86_64-unknown-linux-gnu/libei.a(ei_portio.o):otp/lib/erl_interface/src/misc/ei_portio.h:50: multiple definition of `ei_default_socket_callbacks'; otp/lib/erl_interface/obj/x86_64-unknown-linux-gnu/libei.a(ei_connect.o):otp/lib/erl_interface/src/misc/ei_portio.h:50: first defined here
> +collect2: error: ld returned 1 exit status
> +make[3]: *** [x86_64-unknown-linux-gnu/Makefile:669: otp/lib/erl_interface/bin/x86_64-unknown-linux-gnu/erl_call] Error 1
> +```
> +
> +The failure looks legitimate: `ei_default_socket_callbacks` is a
> +struct defined in 'ei_portio.h' and in 'ei_portio.c'.
> +
> +The change flips 'ei_portio.h' definition to declaration.
> +
> +gcc-10 will change the default from -fcommon to fno-common:
> +https://gcc.gnu.org/PR85678.
> +
> +The error also happens if CFLAGS=-fno-common passed explicitly.
> +
> +Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
> +
> +Patch taken from upstream: https://github.com/erlang/otp/commit/de870d7f9f36b3e68f280057851a4585a67ab219
> +Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
> +---
> + lib/erl_interface/src/misc/ei_portio.h | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/lib/erl_interface/src/misc/ei_portio.h b/lib/erl_interface/src/misc/ei_portio.h
> +index 84ebc5039a..5172d085b4 100644
> +
> +--- a/lib/erl_interface/src/misc/ei_portio.h
> ++++ b/lib/erl_interface/src/misc/ei_portio.h
> +@@ -47,7 +47,7 @@ int ei_writev_fill_ctx_t__(ei_socket_callbacks *cbs, void *ctx, const struct iov
> + int ei_socket_callbacks_have_writev__(ei_socket_callbacks *cbs);
> + #endif
> +
> +-ei_socket_callbacks ei_default_socket_callbacks;
> ++extern ei_socket_callbacks ei_default_socket_callbacks;
> +
> + #define EI_FD_AS_CTX__(FD) \
> + ((void *) (long) (FD))
> +--
> +2.20.1
> +
> --
> 2.20.1
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH 1/1] package/erlang: fix -fno-common build failure
2020-05-17 21:34 [Buildroot] [PATCH 1/1] package/erlang: fix -fno-common build failure Heiko Thiery
2020-05-27 20:27 ` Yann E. MORIN
@ 2020-06-01 20:15 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2020-06-01 20:15 UTC (permalink / raw)
To: buildroot
>>>>> "Heiko" == Heiko Thiery <heiko.thiery@gmail.com> writes:
> Added upstream patch for fixing build failure when using GCC10 as a host
> compiler (-fno-common is now default).
> Cc: Romain Naour <romain.naour@gmail.com>
> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
Committed to 2020.02.x, thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-06-01 20:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-17 21:34 [Buildroot] [PATCH 1/1] package/erlang: fix -fno-common build failure Heiko Thiery
2020-05-27 20:27 ` Yann E. MORIN
2020-06-01 20:15 ` Peter Korsgaard
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.