public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/108027] New: mcf thread model causes build issues for x86_64-w64-mingw32 multilibs
@ 2022-12-09  2:42 unlvsur at live dot com
  2022-12-09  4:20 ` [Bug libstdc++/108027] mcf thread model causes build issues for multilibs of x86_64-w64-mingw32 target lh_mouse at 126 dot com
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: unlvsur at live dot com @ 2022-12-09  2:42 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108027

            Bug ID: 108027
           Summary: mcf thread model causes build issues for
                    x86_64-w64-mingw32 multilibs
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: unlvsur at live dot com
  Target Milestone: ---

Created attachment 54051
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54051&action=edit
config.log and build logs

undefined reference to `__MCF_cxa_thread_atexit'
collect2: error: ld returned 1 exit status
make[9]: *** [Makefile:751: libstdc++.la] Error 1
make[8]: *** [Makefile:784: all-recursive] Error 1
make[7]: *** [Makefile:576: all-recursive] Error 1
make[6]: *** [Makefile:501: all] Error 2
make[5]: *** [Makefile:870: multi-do] Error 1
make[4]: *** [Makefile:840: all-multi] Error 2
make[3]: *** [Makefile:576: all-recursive] Error 1
make[2]: *** [Makefile:501: all] Error 2
make[1]: *** [Makefile:13906: all-target-libstdc++-v3] Error 2
make: *** [Makefile:1029: all] Error 2

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

* [Bug libstdc++/108027] mcf thread model causes build issues for multilibs of x86_64-w64-mingw32 target
  2022-12-09  2:42 [Bug libstdc++/108027] New: mcf thread model causes build issues for x86_64-w64-mingw32 multilibs unlvsur at live dot com
@ 2022-12-09  4:20 ` lh_mouse at 126 dot com
  2022-12-09  4:25 ` unlvsur at live dot com
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: lh_mouse at 126 dot com @ 2022-12-09  4:20 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108027

--- Comment #1 from LIU Hao <lh_mouse at 126 dot com> ---
I need some information about this though:


When multilib is enabled, does GCC still link programs with `-lmsvcrt`? There
seems to be only reference to msvcrt:

  gcc/config/i386/mingw32.h:187:   -lmoldname -lmingwex -lmsvcrt -lkernel32 "
MCFGTHREAD_SPEC

which is followed by `MCFGTHREAD_SPEC`.


If GCC links against libmcfgthread in both m32 and m64, then I suspect there is
only one issue: You forgot to install mcfgthread. I don't know whether libtool
has builtin macros for multilib builds; by default libraries are installed into
`<prefix>/lib` and you have to copy them into `<prefix>/lib32` and
`<prefix>/lib64`, respectively.

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

* [Bug libstdc++/108027] mcf thread model causes build issues for multilibs of x86_64-w64-mingw32 target
  2022-12-09  2:42 [Bug libstdc++/108027] New: mcf thread model causes build issues for x86_64-w64-mingw32 multilibs unlvsur at live dot com
  2022-12-09  4:20 ` [Bug libstdc++/108027] mcf thread model causes build issues for multilibs of x86_64-w64-mingw32 target lh_mouse at 126 dot com
@ 2022-12-09  4:25 ` unlvsur at live dot com
  2022-12-09  4:26 ` unlvsur at live dot com
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: unlvsur at live dot com @ 2022-12-09  4:25 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108027

--- Comment #2 from cqwrteur <unlvsur at live dot com> ---
(In reply to LIU Hao from comment #1)
> I need some information about this though:
> 
> 
> When multilib is enabled, does GCC still link programs with `-lmsvcrt`?
> There seems to be only reference to msvcrt:
> 
>   gcc/config/i386/mingw32.h:187:   -lmoldname -lmingwex -lmsvcrt -lkernel32
> " MCFGTHREAD_SPEC
> 
> which is followed by `MCFGTHREAD_SPEC`.
> 
> 
> If GCC links against libmcfgthread in both m32 and m64, then I suspect there
> is only one issue: You forgot to install mcfgthread. I don't know whether
> libtool has builtin macros for multilib builds; by default libraries are
> installed into `<prefix>/lib` and you have to copy them into
> `<prefix>/lib32` and `<prefix>/lib64`, respectively.

I do install mcfgthread. Yes. I do both of them. The problem is that libtool
will incorrectly link to lib/libmcfgthread.la even lib32/libmcfgthread.la and
lib/32/libmcfgthread.la exist.
Can you just remove the .la file?

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

* [Bug libstdc++/108027] mcf thread model causes build issues for multilibs of x86_64-w64-mingw32 target
  2022-12-09  2:42 [Bug libstdc++/108027] New: mcf thread model causes build issues for x86_64-w64-mingw32 multilibs unlvsur at live dot com
  2022-12-09  4:20 ` [Bug libstdc++/108027] mcf thread model causes build issues for multilibs of x86_64-w64-mingw32 target lh_mouse at 126 dot com
  2022-12-09  4:25 ` unlvsur at live dot com
@ 2022-12-09  4:26 ` unlvsur at live dot com
  2022-12-09  5:38 ` unlvsur at live dot com
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: unlvsur at live dot com @ 2022-12-09  4:26 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108027

--- Comment #3 from cqwrteur <unlvsur at live dot com> ---
(In reply to cqwrteur from comment #2)
> (In reply to LIU Hao from comment #1)
> > I need some information about this though:
> > 
> > 
> > When multilib is enabled, does GCC still link programs with `-lmsvcrt`?
> > There seems to be only reference to msvcrt:
> > 
> >   gcc/config/i386/mingw32.h:187:   -lmoldname -lmingwex -lmsvcrt -lkernel32
> > " MCFGTHREAD_SPEC
> > 
> > which is followed by `MCFGTHREAD_SPEC`.
> > 
> > 
> > If GCC links against libmcfgthread in both m32 and m64, then I suspect there
> > is only one issue: You forgot to install mcfgthread. I don't know whether
> > libtool has builtin macros for multilib builds; by default libraries are
> > installed into `<prefix>/lib` and you have to copy them into
> > `<prefix>/lib32` and `<prefix>/lib64`, respectively.
> 
> I do install mcfgthread. Yes. I do both of them. The problem is that libtool
> will incorrectly link to lib/libmcfgthread.la even lib32/libmcfgthread.la
> and lib/32/libmcfgthread.la exist.
> Can you just remove the .la file?

It finally gets to work by manually replacing all lib/libmcfgthread.la to
lib32/libmcfgthread.la in 32 multilibs.

I do not even think you ever tried how to build multilibs. If you want details,
you can join QQ group 801441303

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

* [Bug libstdc++/108027] mcf thread model causes build issues for multilibs of x86_64-w64-mingw32 target
  2022-12-09  2:42 [Bug libstdc++/108027] New: mcf thread model causes build issues for x86_64-w64-mingw32 multilibs unlvsur at live dot com
                   ` (2 preceding siblings ...)
  2022-12-09  4:26 ` unlvsur at live dot com
@ 2022-12-09  5:38 ` unlvsur at live dot com
  2022-12-09  6:31 ` unlvsur at live dot com
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: unlvsur at live dot com @ 2022-12-09  5:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108027

--- Comment #4 from cqwrteur <unlvsur at live dot com> ---
(In reply to cqwrteur from comment #3)
> (In reply to cqwrteur from comment #2)
> > (In reply to LIU Hao from comment #1)
> > > I need some information about this though:
> > > 
> > > 
> > > When multilib is enabled, does GCC still link programs with `-lmsvcrt`?
> > > There seems to be only reference to msvcrt:
> > > 
> > >   gcc/config/i386/mingw32.h:187:   -lmoldname -lmingwex -lmsvcrt -lkernel32
> > > " MCFGTHREAD_SPEC
> > > 
> > > which is followed by `MCFGTHREAD_SPEC`.
> > > 
> > > 
> > > If GCC links against libmcfgthread in both m32 and m64, then I suspect there
> > > is only one issue: You forgot to install mcfgthread. I don't know whether
> > > libtool has builtin macros for multilib builds; by default libraries are
> > > installed into `<prefix>/lib` and you have to copy them into
> > > `<prefix>/lib32` and `<prefix>/lib64`, respectively.
> > 
> > I do install mcfgthread. Yes. I do both of them. The problem is that libtool
> > will incorrectly link to lib/libmcfgthread.la even lib32/libmcfgthread.la
> > and lib/32/libmcfgthread.la exist.
> > Can you just remove the .la file?
> 
> It finally gets to work by manually replacing all lib/libmcfgthread.la to
> lib32/libmcfgthread.la in 32 multilibs.
> 
> I do not even think you ever tried how to build multilibs. If you want
> details, you can join QQ group 801441303

I do not think it is the problem of libstdc++ itself. It is probably your code
has issues.

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

* [Bug libstdc++/108027] mcf thread model causes build issues for multilibs of x86_64-w64-mingw32 target
  2022-12-09  2:42 [Bug libstdc++/108027] New: mcf thread model causes build issues for x86_64-w64-mingw32 multilibs unlvsur at live dot com
                   ` (3 preceding siblings ...)
  2022-12-09  5:38 ` unlvsur at live dot com
@ 2022-12-09  6:31 ` unlvsur at live dot com
  2022-12-09  8:01 ` lh_mouse at 126 dot com
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: unlvsur at live dot com @ 2022-12-09  6:31 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108027

--- Comment #5 from cqwrteur <unlvsur at live dot com> ---
built toolchain demo. (this is canadian compilation. What I showed was cross
one.)
https://github.com/trcrsired/x86_64-w64-mingw32-with-mcf-thread-model-native-toolchain

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

* [Bug libstdc++/108027] mcf thread model causes build issues for multilibs of x86_64-w64-mingw32 target
  2022-12-09  2:42 [Bug libstdc++/108027] New: mcf thread model causes build issues for x86_64-w64-mingw32 multilibs unlvsur at live dot com
                   ` (4 preceding siblings ...)
  2022-12-09  6:31 ` unlvsur at live dot com
@ 2022-12-09  8:01 ` lh_mouse at 126 dot com
  2022-12-09  8:53 ` lh_mouse at 126 dot com
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: lh_mouse at 126 dot com @ 2022-12-09  8:01 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108027

--- Comment #6 from LIU Hao <lh_mouse at 126 dot com> ---
That's not a GCC bug. That's because you have installed libraries to the
default but wrong location.

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

* [Bug libstdc++/108027] mcf thread model causes build issues for multilibs of x86_64-w64-mingw32 target
  2022-12-09  2:42 [Bug libstdc++/108027] New: mcf thread model causes build issues for x86_64-w64-mingw32 multilibs unlvsur at live dot com
                   ` (5 preceding siblings ...)
  2022-12-09  8:01 ` lh_mouse at 126 dot com
@ 2022-12-09  8:53 ` lh_mouse at 126 dot com
  2022-12-09 11:14 ` unlvsur at live dot com
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: lh_mouse at 126 dot com @ 2022-12-09  8:53 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108027

--- Comment #7 from LIU Hao <lh_mouse at 126 dot com> ---
The .la files generated by libtool are usually nonsense
(https://fedoraproject.org/wiki/Changes/RemoveLaFiles). If you run `make
install` by hand then you may delete them by hand. Some packagers (e.g. makepkg
on Arch Linux and MSYS2) purge them before packaging so they can never get
installed, but some don't (e.g. dpkg-deb on Debian).

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

* [Bug libstdc++/108027] mcf thread model causes build issues for multilibs of x86_64-w64-mingw32 target
  2022-12-09  2:42 [Bug libstdc++/108027] New: mcf thread model causes build issues for x86_64-w64-mingw32 multilibs unlvsur at live dot com
                   ` (6 preceding siblings ...)
  2022-12-09  8:53 ` lh_mouse at 126 dot com
@ 2022-12-09 11:14 ` unlvsur at live dot com
  2022-12-11 10:07 ` lh_mouse at 126 dot com
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: unlvsur at live dot com @ 2022-12-09 11:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108027

--- Comment #8 from cqwrteur <unlvsur at live dot com> ---
(In reply to LIU Hao from comment #7)
> The .la files generated by libtool are usually nonsense
> (https://fedoraproject.org/wiki/Changes/RemoveLaFiles). If you run `make
> install` by hand then you may delete them by hand. Some packagers (e.g.
> makepkg on Arch Linux and MSYS2) purge them before packaging so they can
> never get installed, but some don't (e.g. dpkg-deb on Debian).

if I delete them by hand, then gcc could not build anymore since build scripts
of libstdc++ would complain .la do not exist

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

* [Bug libstdc++/108027] mcf thread model causes build issues for multilibs of x86_64-w64-mingw32 target
  2022-12-09  2:42 [Bug libstdc++/108027] New: mcf thread model causes build issues for x86_64-w64-mingw32 multilibs unlvsur at live dot com
                   ` (7 preceding siblings ...)
  2022-12-09 11:14 ` unlvsur at live dot com
@ 2022-12-11 10:07 ` lh_mouse at 126 dot com
  2022-12-11 10:25 ` unlvsur at live dot com
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: lh_mouse at 126 dot com @ 2022-12-11 10:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108027

--- Comment #9 from LIU Hao <lh_mouse at 126 dot com> ---
(In reply to cqwrteur from comment #8)
> if I delete them by hand, then gcc could not build anymore since build
> scripts of libstdc++ would complain .la do not exist

No library in MSYS2 has been installed with .la files because they are never
necessary.

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

* [Bug libstdc++/108027] mcf thread model causes build issues for multilibs of x86_64-w64-mingw32 target
  2022-12-09  2:42 [Bug libstdc++/108027] New: mcf thread model causes build issues for x86_64-w64-mingw32 multilibs unlvsur at live dot com
                   ` (8 preceding siblings ...)
  2022-12-11 10:07 ` lh_mouse at 126 dot com
@ 2022-12-11 10:25 ` unlvsur at live dot com
  2022-12-11 10:30 ` lh_mouse at 126 dot com
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: unlvsur at live dot com @ 2022-12-11 10:25 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108027

--- Comment #10 from cqwrteur <unlvsur at live dot com> ---
(In reply to LIU Hao from comment #9)
> (In reply to cqwrteur from comment #8)
> > if I delete them by hand, then gcc could not build anymore since build
> > scripts of libstdc++ would complain .la do not exist
> 
> No library in MSYS2 has been installed with .la files because they are never
> necessary.

i do not even understand why you are talking about msys2. I do Canadian
compilation on linux. Cross compiling mcfgthread on Linux. This has nothing to
do with msys2.

I do not use msys2.

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

* [Bug libstdc++/108027] mcf thread model causes build issues for multilibs of x86_64-w64-mingw32 target
  2022-12-09  2:42 [Bug libstdc++/108027] New: mcf thread model causes build issues for x86_64-w64-mingw32 multilibs unlvsur at live dot com
                   ` (9 preceding siblings ...)
  2022-12-11 10:25 ` unlvsur at live dot com
@ 2022-12-11 10:30 ` lh_mouse at 126 dot com
  2022-12-11 10:31 ` unlvsur at live dot com
  2022-12-11 10:32 ` unlvsur at live dot com
  12 siblings, 0 replies; 14+ messages in thread
From: lh_mouse at 126 dot com @ 2022-12-11 10:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108027

--- Comment #11 from LIU Hao <lh_mouse at 126 dot com> ---
It has nothing to do with MSYS2. MSYS2 is merely an example to show that .la
files are not necessary and should not be installed.

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

* [Bug libstdc++/108027] mcf thread model causes build issues for multilibs of x86_64-w64-mingw32 target
  2022-12-09  2:42 [Bug libstdc++/108027] New: mcf thread model causes build issues for x86_64-w64-mingw32 multilibs unlvsur at live dot com
                   ` (10 preceding siblings ...)
  2022-12-11 10:30 ` lh_mouse at 126 dot com
@ 2022-12-11 10:31 ` unlvsur at live dot com
  2022-12-11 10:32 ` unlvsur at live dot com
  12 siblings, 0 replies; 14+ messages in thread
From: unlvsur at live dot com @ 2022-12-11 10:31 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108027

--- Comment #12 from cqwrteur <unlvsur at live dot com> ---
(In reply to LIU Hao from comment #11)
> It has nothing to do with MSYS2. MSYS2 is merely an example to show that .la
> files are not necessary and should not be installed.

but your build scripts do that.

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

* [Bug libstdc++/108027] mcf thread model causes build issues for multilibs of x86_64-w64-mingw32 target
  2022-12-09  2:42 [Bug libstdc++/108027] New: mcf thread model causes build issues for x86_64-w64-mingw32 multilibs unlvsur at live dot com
                   ` (11 preceding siblings ...)
  2022-12-11 10:31 ` unlvsur at live dot com
@ 2022-12-11 10:32 ` unlvsur at live dot com
  12 siblings, 0 replies; 14+ messages in thread
From: unlvsur at live dot com @ 2022-12-11 10:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108027

--- Comment #13 from cqwrteur <unlvsur at live dot com> ---
(In reply to cqwrteur from comment #12)
> (In reply to LIU Hao from comment #11)
> > It has nothing to do with MSYS2. MSYS2 is merely an example to show that .la
> > files are not necessary and should not be installed.
> 
> but your build scripts do that.

I would even argue cmake would be better than autotool for you mcfgthread

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

end of thread, other threads:[~2022-12-11 10:32 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-09  2:42 [Bug libstdc++/108027] New: mcf thread model causes build issues for x86_64-w64-mingw32 multilibs unlvsur at live dot com
2022-12-09  4:20 ` [Bug libstdc++/108027] mcf thread model causes build issues for multilibs of x86_64-w64-mingw32 target lh_mouse at 126 dot com
2022-12-09  4:25 ` unlvsur at live dot com
2022-12-09  4:26 ` unlvsur at live dot com
2022-12-09  5:38 ` unlvsur at live dot com
2022-12-09  6:31 ` unlvsur at live dot com
2022-12-09  8:01 ` lh_mouse at 126 dot com
2022-12-09  8:53 ` lh_mouse at 126 dot com
2022-12-09 11:14 ` unlvsur at live dot com
2022-12-11 10:07 ` lh_mouse at 126 dot com
2022-12-11 10:25 ` unlvsur at live dot com
2022-12-11 10:30 ` lh_mouse at 126 dot com
2022-12-11 10:31 ` unlvsur at live dot com
2022-12-11 10:32 ` unlvsur at live dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).