Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 922124 - Error compiling cross-gcc-stage1 (cross-i686-w64-mingw32) on the clang profile
Summary: Error compiling cross-gcc-stage1 (cross-i686-w64-mingw32) on the clang profile
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2024-01-14 19:01 UTC by Gonçalo Negrier Duarte
Modified: 2024-01-23 16:35 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
cross-i686-w64-mingw32-gcc-stage1.log (cross-i686-w64-mingw32-gcc-stage1.log.xz,87.92 KB, application/x-xz)
2024-01-14 19:02 UTC, Gonçalo Negrier Duarte
Details
cross-i686-w64-mingw32-info.log (cross-i686-w64-mingw32-info.log,19.66 KB, text/x-log)
2024-01-14 19:02 UTC, Gonçalo Negrier Duarte
Details
mingw-libcxx17.patch (mingw-libcxx17.patch,822 bytes, patch)
2024-01-14 19:31 UTC, Ionen Wolkens
Details | Diff
fix-mingw-libcxx17.patch (mingw-libcxx17.patch,685 bytes, patch)
2024-01-14 20:14 UTC, Gonçalo Negrier Duarte
Details | Diff
cross-i686-w64-mingw32-gcc-stage1.log (cross-i686-w64-mingw32-gcc-stage1.log.xz,108.60 KB, application/x-xz)
2024-01-14 20:20 UTC, Gonçalo Negrier Duarte
Details
cross-i686-w64-mingw32-gcc-stage1.log (cross-i686-w64-mingw32-gcc-stage1.log.xz,89.08 KB, application/x-xz)
2024-01-23 16:35 UTC, Gonçalo Negrier Duarte
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gonçalo Negrier Duarte 2024-01-14 19:01:05 UTC
I can compile cross-gcc-stage1 in the cross-i686-w64-mingw32 when using the clang profile.

The logs are included on the attachments
Comment 1 Gonçalo Negrier Duarte 2024-01-14 19:02:06 UTC
Created attachment 882279 [details]
cross-i686-w64-mingw32-gcc-stage1.log
Comment 2 Gonçalo Negrier Duarte 2024-01-14 19:02:29 UTC
Created attachment 882280 [details]
cross-i686-w64-mingw32-info.log
Comment 3 Ionen Wolkens gentoo-dev 2024-01-14 19:08:14 UTC
fwiw mingw64-toolchain (includes gcc) builds fine on clang profiles (even llvm-musl), albeit I never test crossdev there

May be related to more things being enabled compared to mingw64-toolchain (or at least in stage1).
Comment 4 Ionen Wolkens gentoo-dev 2024-01-14 19:21:29 UTC
/usr/include/c++/v1/locale:289:36: error: attempt to use a poisoned identifier
  289 |         __status = (unsigned char*)malloc(__nkw);

Wait a minute, I remember this now. Looks a lot like bug #914565 and bug #912035, but afaik it should be fixed in the version you're using?

mingw64-toolchain isn't using snapshots, so it still has the patch for it.
Comment 5 Ionen Wolkens gentoo-dev 2024-01-14 19:23:06 UTC
(In reply to Ionen Wolkens from comment #4)
> Wait a minute, I remember this now. Looks a lot like bug #914565 and bug
> #912035, but afaik it should be fixed in the version you're using?
Well, bug #912035 was a bit different. So maybe it didn't fix all the libcxx17 issues.
Comment 6 Ionen Wolkens gentoo-dev 2024-01-14 19:31:33 UTC
Created attachment 882281 [details, diff]
mingw-libcxx17.patch

Have not tested it with crossdev and current snapshots, but I assume the attached gcc patch would let it build.
Comment 7 Gonçalo Negrier Duarte 2024-01-14 20:10:47 UTC
Ionen the patch dosen't seem right this part no longer exist in the system.h file:
```
@@ -230,7 +233,4 @@
 # include <set>
 #endif
-#ifdef INCLUDE_VECTOR
-# include <vector>
-#endif
 #ifdef INCLUDE_ARRAY
 # include <array>
```
I just removed from the patch
Comment 8 Gonçalo Negrier Duarte 2024-01-14 20:13:16 UTC
Patch failing log:
```
 * Applying user patches from /etc/portage/patches ...
 * Applying mingw-libcxx17.patch ...
patching file gcc/system.h
Hunk #1 succeeded at 597 with fuzz 1 (offset 395 lines).
Hunk #2 FAILED at 233.
1 out of 2 hunks FAILED -- saving rejects to file gcc/system.h.rej
patching file libcc1/libcc1plugin.cc
patching file libcc1/libcp1plugin.cc                                     [ !! ]
```

After removed the lines on https://bugs.gentoo.org/922124#c7 it seems to be compiling, let see if fails.
Comment 9 Gonçalo Negrier Duarte 2024-01-14 20:14:19 UTC
Created attachment 882290 [details, diff]
fix-mingw-libcxx17.patch
Comment 10 Gonçalo Negrier Duarte 2024-01-14 20:20:18 UTC
Created attachment 882291 [details]
cross-i686-w64-mingw32-gcc-stage1.log

Still failing probably is because of LLVM 17 toolchain
But the error seems differente now
```
for file in $parts; do					\
  rm -f /var/tmp/portage/cross-i686-w64-mingw32/gcc-13.2.1_p20231216/image/usr/lib/gcc/i686-w64-mingw32/13/$file;		\
  /usr/lib/portage/python3.11/ebuild-helpers/xattr/install -c -m 644 $file /var/tmp/portage/cross-i686-w64-mingw32/gcc-13.2.1_p20231216/image/usr/lib/gcc/i686-w64-mingw32/13/;	\
  case $file in 					\
    *.a)						\
      /usr/libexec/gcc/i686-w64-mingw32/ranlib ../.././gcc/$file ;;	\
  esac;							\
done
```
Comment 11 Ionen Wolkens gentoo-dev 2024-01-14 20:23:43 UTC
Oh sorry, I based the patch on gcc-13-20231216.tar.xz but forgot to account for gentoo's patchset which conflicts with it.
Comment 12 Gonçalo Negrier Duarte 2024-01-14 21:49:25 UTC
(In reply to Ionen Wolkens from comment #11)
> Oh sorry, I based the patch on gcc-13-20231216.tar.xz but forgot to account
> for gentoo's patchset which conflicts with it.

No problem you have given a look at the new log file?
Comment 13 Ionen Wolkens gentoo-dev 2024-01-14 22:47:52 UTC
(In reply to Gonçalo Negrier Duarte from comment #12)
> (In reply to Ionen Wolkens from comment #11)
> > Oh sorry, I based the patch on gcc-13-20231216.tar.xz but forgot to account
> > for gentoo's patchset which conflicts with it.
> 
> No problem you have given a look at the new log file?
Yes, but that's not a problem I had with mingw64-toolchain+llvm, so I don't have insight for it unlike the libcxx poisoning patch (I maintain that package but I don't really handle crossdev gcc, was just checking for similarities that could help).
Comment 14 Gonçalo Negrier Duarte 2024-01-15 11:06:54 UTC
Ok no problem thanks for the help I can wait for a fix no problem.
Comment 15 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-01-23 05:33:36 UTC
13.2.1_p20240113-r1 is stable now which fixes the include issue hopefully.

The other issue presumably remains.
Comment 16 Gonçalo Negrier Duarte 2024-01-23 14:01:06 UTC
Ok Sam I gonna test and report back
Comment 17 Gonçalo Negrier Duarte 2024-01-23 16:34:27 UTC
Still dosent compile after the update
Comment 18 Gonçalo Negrier Duarte 2024-01-23 16:35:18 UTC
Created attachment 882989 [details]
cross-i686-w64-mingw32-gcc-stage1.log

New logs uploaded