Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/tmux: fix BR2_SHARED_STATIC_LIBS
@ 2023-02-19 23:23 Fabrice Fontaine
  2023-02-20 21:07 ` Thomas Petazzoni via buildroot
  2023-02-20 21:10 ` Yann E. MORIN
  0 siblings, 2 replies; 4+ messages in thread
From: Fabrice Fontaine @ 2023-02-19 23:23 UTC (permalink / raw)
  To: buildroot; +Cc: Yann E . MORIN, Fabrice Fontaine

tmux uses custom --enable-static option, instead of standard libtool
directive resulting in the following build failure with systemd or
utf8proc raised since commits
1f618aa388535181c281c85e2b5264532de4ef0f and
e279599d255a79c08ef20b97b96eb248689d52a9:

checking for utf8proc.h... yes
checking for library containing utf8proc_charwidth... no
configure: error: "utf8proc not found"

In file included from tmux.h:34,
                 from alerts.c:23:
compat.h:379:18: error: conflicting types for 'forkpty'; have 'pid_t(int *, char *, struct termios *, struct winsize *)' {aka 'int(int *, char *, struct termios *, struct winsize *)'}
  379 | pid_t            forkpty(int *, char *, struct termios *, struct winsize *);
      |                  ^~~~~~~

Link to (closed) upstream issue:
https://github.com/tmux/tmux/issues/3290

Fixes:
 - http://autobuild.buildroot.org/results/6e8523d8d514bf6d8fc3377d05e5edbe7fc2d5bb
 - http://autobuild.buildroot.org/results/cba06f3bb6d9be25e91f56c390a70ddf9904832e

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/tmux/tmux.mk | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/package/tmux/tmux.mk b/package/tmux/tmux.mk
index 47ee9b16ca..af06c8570b 100644
--- a/package/tmux/tmux.mk
+++ b/package/tmux/tmux.mk
@@ -25,6 +25,12 @@ else
 TMUX_CONF_OPTS += --disable-utf8proc
 endif
 
+# tmux uses custom --enable-static option, instead of standard libtool
+# directive resulting in a build failure with systemd or utf8proc
+ifeq ($(BR2_SHARED_STATIC_LIBS),y)
+TMUX_CONF_OPTS += --disable-static
+endif
+
 # Add /usr/bin/tmux to /etc/shells otherwise some login tools like dropbear
 # can reject the user connection. See man shells.
 define TMUX_ADD_TMUX_TO_SHELLS
-- 
2.39.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/tmux: fix BR2_SHARED_STATIC_LIBS
  2023-02-19 23:23 [Buildroot] [PATCH 1/1] package/tmux: fix BR2_SHARED_STATIC_LIBS Fabrice Fontaine
@ 2023-02-20 21:07 ` Thomas Petazzoni via buildroot
  2023-02-20 22:23   ` Fabrice Fontaine
  2023-02-20 21:10 ` Yann E. MORIN
  1 sibling, 1 reply; 4+ messages in thread
From: Thomas Petazzoni via buildroot @ 2023-02-20 21:07 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: Yann E . MORIN, buildroot

Hello Fabrice,

On Mon, 20 Feb 2023 00:23:01 +0100
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> tmux uses custom --enable-static option, instead of standard libtool
> directive resulting in the following build failure with systemd or
> utf8proc raised since commits
> 1f618aa388535181c281c85e2b5264532de4ef0f and
> e279599d255a79c08ef20b97b96eb248689d52a9:

I am rather confused by the reasoning here.

> checking for utf8proc.h... yes
> checking for library containing utf8proc_charwidth... no
> configure: error: "utf8proc not found"

So this one is:

  http://autobuild.buildroot.net/results/6e8/6e8523d8d514bf6d8fc3377d05e5edbe7fc2d5bb/build-end.log
  http://autobuild.buildroot.net/results/623/62309091c9da69eb29c3e9464aa95d089ce886f8/build-end.log

I think here the problem is indeed that tmux interprets --enable-static
as "please provide a statically linked binary" instead of the standard
"please build/install static libraries".

So, when it tries to detect libutf8proc, it doesn't find it:

/home/autobuild/autobuild/instance-13/output-1/host/lib/gcc/or1k-buildroot-linux-musl/11.3.0/../../../../or1k-buildroot-linux-musl/bin/ld: cannot find -lutf8proc: No such file or directory

because utf8proc is based on CMake, and CMake is not able to build both
shared and static libraries, so in the BR2_STATIC_SHARED_LIBS=y case,
it only installs shared libraries. Because the above utf8proc library
test is done with -static, it requires a static variant of libutf8proc,
which isn't there.

So indeed, for this case, it makes sense to not pass --enable-static to
tmux, but it's both due to tmux having a non-standard behavior for
--enable-static *AND* the fact that utf8proc also doesn't behave
properly in the BR2_STATIC_SHARED_LIBS=y case.

> In file included from tmux.h:34,
>                  from alerts.c:23:
> compat.h:379:18: error: conflicting types for 'forkpty'; have 'pid_t(int *, char *, struct termios *, struct winsize *)' {aka 'int(int *, char *, struct termios *, struct winsize *)'}
>   379 | pid_t            forkpty(int *, char *, struct termios *, struct winsize *);
>       |                  ^~~~~~~


However this one, I am really, really confused as to how it can be
related to BR2_STATIC_SHARED_LIBS and --enable-static. Could you
provide some more details on the reasoning?

Thanks!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/tmux: fix BR2_SHARED_STATIC_LIBS
  2023-02-19 23:23 [Buildroot] [PATCH 1/1] package/tmux: fix BR2_SHARED_STATIC_LIBS Fabrice Fontaine
  2023-02-20 21:07 ` Thomas Petazzoni via buildroot
@ 2023-02-20 21:10 ` Yann E. MORIN
  1 sibling, 0 replies; 4+ messages in thread
From: Yann E. MORIN @ 2023-02-20 21:10 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: buildroot

Fabrice, All,

On 2023-02-20 00:23 +0100, Fabrice Fontaine spake thusly:
> tmux uses custom --enable-static option, instead of standard libtool
> directive

In fact, the purpose is also different: libtool's --enable-static drives
whether to generate static libraries, while tmux' --enable-static drives
whether to link against static libraries.

So, not unrelated, but still different.

> resulting in the following build failure with systemd or
> utf8proc raised since commits
> 1f618aa388535181c281c85e2b5264532de4ef0f and
> e279599d255a79c08ef20b97b96eb248689d52a9:
> 
> checking for utf8proc.h... yes
> checking for library containing utf8proc_charwidth... no
> configure: error: "utf8proc not found"
> 
> In file included from tmux.h:34,
>                  from alerts.c:23:
> compat.h:379:18: error: conflicting types for 'forkpty'; have 'pid_t(int *, char *, struct termios *, struct winsize *)' {aka 'int(int *, char *, struct termios *, struct winsize *)'}
>   379 | pid_t            forkpty(int *, char *, struct termios *, struct winsize *);
>       |                  ^~~~~~~
> 
> Link to (closed) upstream issue:
> https://github.com/tmux/tmux/issues/3290
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/6e8523d8d514bf6d8fc3377d05e5edbe7fc2d5bb
>  - http://autobuild.buildroot.org/results/cba06f3bb6d9be25e91f56c390a70ddf9904832e
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

Applied to master, thanks.

Regards,
Yann E. MORIN.

> ---
>  package/tmux/tmux.mk | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/package/tmux/tmux.mk b/package/tmux/tmux.mk
> index 47ee9b16ca..af06c8570b 100644
> --- a/package/tmux/tmux.mk
> +++ b/package/tmux/tmux.mk
> @@ -25,6 +25,12 @@ else
>  TMUX_CONF_OPTS += --disable-utf8proc
>  endif
>  
> +# tmux uses custom --enable-static option, instead of standard libtool
> +# directive resulting in a build failure with systemd or utf8proc
> +ifeq ($(BR2_SHARED_STATIC_LIBS),y)
> +TMUX_CONF_OPTS += --disable-static
> +endif
> +
>  # Add /usr/bin/tmux to /etc/shells otherwise some login tools like dropbear
>  # can reject the user connection. See man shells.
>  define TMUX_ADD_TMUX_TO_SHELLS
> -- 
> 2.39.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/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.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/tmux: fix BR2_SHARED_STATIC_LIBS
  2023-02-20 21:07 ` Thomas Petazzoni via buildroot
@ 2023-02-20 22:23   ` Fabrice Fontaine
  0 siblings, 0 replies; 4+ messages in thread
From: Fabrice Fontaine @ 2023-02-20 22:23 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: Yann E . MORIN, buildroot


[-- Attachment #1.1: Type: text/plain, Size: 3789 bytes --]

Le lun. 20 févr. 2023 à 22:07, Thomas Petazzoni <
thomas.petazzoni@bootlin.com> a écrit :

> Hello Fabrice,
>
> On Mon, 20 Feb 2023 00:23:01 +0100
> Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:
>
> > tmux uses custom --enable-static option, instead of standard libtool
> > directive resulting in the following build failure with systemd or
> > utf8proc raised since commits
> > 1f618aa388535181c281c85e2b5264532de4ef0f and
> > e279599d255a79c08ef20b97b96eb248689d52a9:
>
> I am rather confused by the reasoning here.
>
> > checking for utf8proc.h... yes
> > checking for library containing utf8proc_charwidth... no
> > configure: error: "utf8proc not found"
>
> So this one is:
>
>
> http://autobuild.buildroot.net/results/6e8/6e8523d8d514bf6d8fc3377d05e5edbe7fc2d5bb/build-end.log
>
> http://autobuild.buildroot.net/results/623/62309091c9da69eb29c3e9464aa95d089ce886f8/build-end.log
>
> I think here the problem is indeed that tmux interprets --enable-static
> as "please provide a statically linked binary" instead of the standard
> "please build/install static libraries".
>
> So, when it tries to detect libutf8proc, it doesn't find it:
>
> /home/autobuild/autobuild/instance-13/output-1/host/lib/gcc/or1k-buildroot-linux-musl/11.3.0/../../../../or1k-buildroot-linux-musl/bin/ld:
> cannot find -lutf8proc: No such file or directory
>
> because utf8proc is based on CMake, and CMake is not able to build both
> shared and static libraries, so in the BR2_STATIC_SHARED_LIBS=y case,
> it only installs shared libraries. Because the above utf8proc library
> test is done with -static, it requires a static variant of libutf8proc,
> which isn't there.
>
> So indeed, for this case, it makes sense to not pass --enable-static to
> tmux, but it's both due to tmux having a non-standard behavior for
> --enable-static *AND* the fact that utf8proc also doesn't behave
> properly in the BR2_STATIC_SHARED_LIBS=y case.
>
> > In file included from tmux.h:34,
> >                  from alerts.c:23:
> > compat.h:379:18: error: conflicting types for 'forkpty'; have 'pid_t(int
> *, char *, struct termios *, struct winsize *)' {aka 'int(int *, char *,
> struct termios *, struct winsize *)'}
> >   379 | pid_t            forkpty(int *, char *, struct termios *, struct
> winsize *);
> >       |                  ^~~~~~~
>
>
> However this one, I am really, really confused as to how it can be
> related to BR2_STATIC_SHARED_LIBS and --enable-static. Could you
> provide some more details on the reasoning?
>

This is the same issue, availability of forkpty in systemd is wrongly
detected because of --static.
Here is an extract of
http://autobuild.buildroot.org/results/cba/cba06f3bb6d9be25e91f56c390a70ddf9904832e//tmux-3.3a/config.log
:

configure:7278:
/home/autobuild/autobuild/instance-12/output-1/host/bin/powerpc64-buildroot-linux-gnu-gcc
-o conftest -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
-D_FILE_OFFSET_BITS=64  -O2 -g0 -D_FORTIFY_SOURCE=2  -D_DEFAULT_SOURCE
-D_XOPEN_SOURCE=600    -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
-D_FILE_OFFSET_BITS=64 -static   conftest.c -lutil
-L/home/autobuild/autobuild/instance-12/output-1/host/bin/../powerpc64-buildroot-linux-gnu/sysroot/usr/lib
-lsystemd  -lncurses
-L/home/autobuild/autobuild/instance-12/output-1/host/bin/../powerpc64-buildroot-linux-gnu/sysroot/usr/lib
-levent_core  -lm  >&5
/home/autobuild/autobuild/instance-12/output-1/host/lib/gcc/powerpc64-buildroot-linux-gnu/11.3.0/../../../../powerpc64-buildroot-linux-gnu/bin/ld:
cannot find -lsystemd



>
> Thanks!
>
> Thomas
> --
> Thomas Petazzoni, co-owner and CEO, Bootlin
> Embedded Linux and Kernel engineering and training
> https://bootlin.com
>

Best Regards,

Fabrice

[-- Attachment #1.2: Type: text/html, Size: 5152 bytes --]

[-- Attachment #2: Type: text/plain, Size: 150 bytes --]

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-02-21  2:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-19 23:23 [Buildroot] [PATCH 1/1] package/tmux: fix BR2_SHARED_STATIC_LIBS Fabrice Fontaine
2023-02-20 21:07 ` Thomas Petazzoni via buildroot
2023-02-20 22:23   ` Fabrice Fontaine
2023-02-20 21:10 ` Yann E. MORIN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox