Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 763261 - sys-devel/crossdev-20201129 using sys-apps/portage-3.0.12 to build mingw64-runtime-8.0.0: compiler generates too many warnings resulting in large log files
Summary: sys-devel/crossdev-20201129 using sys-apps/portage-3.0.12 to build mingw64-ru...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Gentoo Crossdev team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-03 12:29 UTC by Juozas Pocius
Modified: 2021-01-03 17:51 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Juozas Pocius 2021-01-03 12:29:13 UTC
While using crossdev to set up mingw-w64 toolchain compiler generates too many warnings about the use of "defined" not being portable while building mingw64-runtime package, on both 32 bit and 64 bit mingw (*-w64-mingw32) architectures, resulting in huge log files wasting disk space.

The warnings generated by compiler are like below, with a very similar warning repeating multiple times:

/var/tmp/portage/cross-i686-w64-mingw32/mingw64-runtime-8.0.0/temp/tmproot/include/psdk_inc/intrin-impl.h:598:1: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
/var/tmp/portage/cross-i686-w64-mingw32/mingw64-runtime-8.0.0/temp/tmproot/include/psdk_inc/intrin-impl.h:598:1: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
/var/tmp/portage/cross-i686-w64-mingw32/mingw64-runtime-8.0.0/temp/tmproot/include/psdk_inc/intrin-impl.h:598:1: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
/var/tmp/portage/cross-i686-w64-mingw32/mingw64-runtime-8.0.0/temp/tmproot/include/psdk_inc/intrin-impl.h:1383:1: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
 1383 | #if __INTRINSIC_PROLOG(__popcnt16)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The process of creating toolchain is as follows:

1. Install crossdev

# emerge --ask sys-devel/crossdev

2. Try to run crossdev, it would fail with overlay error upon execution, after running commands listed below (lke in Crossdev section of Custom ebuild repository wiki page) the problem would be avoided.

# crossdev --target x86_64-w64-mingw32

3. As above would fail, create Custom ebuild repository following commands below, thus avoiding the error above.

# cd /var/db/repos/
# mkdir -p localrepo-crossdev/{profiles,metadata}
# echo 'masters = gentoo' > localrepo-crossdev/metadata/layout.conf
# echo 'crossdev' > localrepo-crossdev/profiles/repo_name
# chown -R portage:portage /var/db/repos/localrepo-crossdev

4. Create/edit /etc/portage/repos.conf/crossdev.conf adding the lines below to the file.

[crossdev]
location = /var/db/repos/localrepo-crossdev
priority = 10
masters = gentoo
autosync = no

5. Rerun crossdev, toolchain would compile fine, but would produce large log files full of warnings (e.g. over 130000 lines of over 200000 total lines) while compiling mingw64-runtime package

# crossdev --target x86_64-w64-mingw32
# crossdev --target i686-w64-mingw32

Gentoo is installed on VirtualBox vm, With 1GB ram allocated to virtual machine on build time and with additional 1 GB swap present on installation.

Crossdev: sys-devel/crossdev, version 20201129
Dependencies app-arch/xz-utils-5.2.5 sys-apps/portage-3.0.12 app-portage/portage-utils-0.90 app-shells/bash-5.0_p18 sys-apps/gentoo-functions-0.13, no use flags present
Comment 1 Sergei Trofimovich (RETIRED) gentoo-dev 2021-01-03 17:51:42 UTC
(In reply to Juozas Pocius from comment #0)
> While using crossdev to set up mingw-w64 toolchain compiler generates too
> many warnings about the use of "defined" not being portable while building
> mingw64-runtime package, on both 32 bit and 64 bit mingw (*-w64-mingw32)
> architectures, resulting in huge log files wasting disk space.
> 
> The warnings generated by compiler are like below, with a very similar
> warning repeating multiple times:
> 
> /var/tmp/portage/cross-i686-w64-mingw32/mingw64-runtime-8.0.0/temp/tmproot/
> include/psdk_inc/intrin-impl.h:598:1: warning: this use of "defined" may not
> be portable [-Wexpansion-to-defined]
> /var/tmp/portage/cross-i686-w64-mingw32/mingw64-runtime-8.0.0/temp/tmproot/
> include/psdk_inc/intrin-impl.h:598:1: warning: this use of "defined" may not
> be portable [-Wexpansion-to-defined]
> /var/tmp/portage/cross-i686-w64-mingw32/mingw64-runtime-8.0.0/temp/tmproot/
> include/psdk_inc/intrin-impl.h:598:1: warning: this use of "defined" may not
> be portable [-Wexpansion-to-defined]
> /var/tmp/portage/cross-i686-w64-mingw32/mingw64-runtime-8.0.0/temp/tmproot/
> include/psdk_inc/intrin-impl.h:1383:1: warning: this use of "defined" may
> not be portable [-Wexpansion-to-defined]
>  1383 | #if __INTRINSIC_PROLOG(__popcnt16)
>       | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Gentoo does not normally fix warning downstream if those don't cause real problems. I suggest following up with mingw64-runtime upstream if you'd like to address build warnings:
    http://mingw-w64.org/doku.php/support

Then we can pull in new fixed version of backport fix if really needed.

> 5. Rerun crossdev, toolchain would compile fine, but would produce large log
> files full of warnings (e.g. over 130000 lines of over 200000 total lines)
> while compiling mingw64-runtime package

```
$ LANG=C ls -lh cross-x86_64-w64-mingw32:mingw64-runtime-*.log
-rw-rw---- 1 portage portage  32M Sep 27 05:54 cross-x86_64-w64-mingw32:mingw64-runtime-7.0.0-r1:20200927-045225.log
-rw-rw---- 1 portage portage 151K Sep 27 05:54 cross-x86_64-w64-mingw32:mingw64-runtime-7.0.0-r1:20200927-045405.log
-rw-rw---- 1 portage portage 151K Sep 30 19:29 cross-x86_64-w64-mingw32:mingw64-runtime-7.0.0-r1:20200930-182907.log
-rw-rw---- 1 portage portage  47M Sep 30 19:29 cross-x86_64-w64-mingw32:mingw64-runtime-8.0.0:20200930-182559.log
-rw-rw---- 1 portage portage  42M Oct 30 23:29 cross-x86_64-w64-mingw32:mingw64-runtime-8.0.0:20201030-232143.log
-rw-rw---- 1 portage portage 151K Oct 30 23:29 cross-x86_64-w64-mingw32:mingw64-runtime-8.0.0:20201030-232852.log
-rw-rw---- 1 slyfox  portage 324K Nov  9 08:35 cross-x86_64-w64-mingw32:mingw64-runtime-8.0.0:20201109-083542.log
-rw-rw---- 1 slyfox  portage 810K Nov  9 08:41 cross-x86_64-w64-mingw32:mingw64-runtime-8.0.0:20201109-084022.log
-rw-rw---- 1 slyfox  portage 3.0M Nov  9 19:32 cross-x86_64-w64-mingw32:mingw64-runtime-8.0.0:20201109-084132.log
-rw-rw---- 1 portage portage  42M Nov 30 06:20 cross-x86_64-w64-mingw32:mingw64-runtime-8.0.0:20201130-061706.log
-rw-rw---- 1 portage portage 151K Nov 30 06:20 cross-x86_64-w64-mingw32:mingw64-runtime-8.0.0:20201130-061959.log
-rw-rw---- 1 portage portage  42M Dec 30 16:15 cross-x86_64-w64-mingw32:mingw64-runtime-8.0.0:20201230-161222.log
-rw-rw---- 1 portage portage 151K Dec 30 16:14 cross-x86_64-w64-mingw32:mingw64-runtime-8.0.0:20201230-161450.log
```

Are we talking about tens of megabytes of temporary storage here here? It does not sound like a large overhead for a build system.