Skip to content

gcc: split packages like Arch did while preserving upgrades - #30473

Open
dragon-archer wants to merge 1 commit into
msys2:masterfrom
dragon-archer:split-gcc
Open

gcc: split packages like Arch did while preserving upgrades#30473
dragon-archer wants to merge 1 commit into
msys2:masterfrom
dragon-archer:split-gcc

Conversation

@dragon-archer

Copy link
Copy Markdown
Collaborator

Keep gcc-libs as a compatibility package that depends on the new cc-libs metapackage and libgomp.

The previous split (#28751) moved the omp provision from gcc-libs to libgomp without retaining a dependency edge between them. During a system upgrade, the old gcc-libs package had to be removed because the split runtime packages took ownership of its files. This also removed the only installed omp provider.

Although libgomp provides omp, pacman only searches for providers while resolving forward dependencies of packages already selected for the transaction. The missing omp dependency was detected later, during the final reverse-dependency validation. That validation reports broken dependencies but does not add new provider packages to the transaction, so libgomp was never selected automatically.

Add a concrete cc-libs package for the common GCC runtime libraries and turn gcc-libs into a compatibility package depending on matching versions of cc-libs and libgomp. Upgrading the installed gcc-libs package now pulls libgomp into the transaction before reverse-dependency validation, preserving all existing omp dependencies.

Keeping libgomp outside cc-libs also allows new common-runtime consumers to avoid installing the OpenMP runtime when it is not required.

Move the tzdata dependency to libstdc++, which is the component using the C++ time-zone database.

@dragon-archer

Copy link
Copy Markdown
Collaborator Author

@lazka @MehdiChinoune How about merging this?

@dragon-archer

Copy link
Copy Markdown
Collaborator Author

Overhauled the packaging process like Arch, with a few differences:

  1. All static libraries with shared varients are installed in lib/ instead of _libdir/ (lib/gcc/${CHOST}/${pkgver}), because:
    • We don't need to support multiple gcc version co-existing
    • _libdir/ is searched before lib/, which means that if libatomic.a is in _libdir/, while libatomic.dll.a is in lib/, then GCC will default to link the static version. If we also install libatomic.dll.a in _libdir/, then manual calls to ld will fail (but ok if the link is called from gcc/clang).
  2. Static libraries and import libraries of core runtime libraries (lib{atomic,gcc,quadmath,stdc++}) are currently packed into gcc to keep them as small as possible.
  3. All symlinks are replaced with hardlinks.

There're still a few points which may need discussion and/or adjustion:

  1. License: I tried my best to find the most proper license for split packages, but I'm not an expert in this. I'm not very confident of whether the licenses installed now is correct.
  2. libatomic and libquadmath: These 2 packages should actually be moved from cc-libs to gcc-libs, as they're seldom used, and IMHO we should try making cc-libs contain only "C/C++ Standard Libraries", just like libc++. From this comment, it should be relatively safe to move them, but I'm not sure whether you want to do this transition now or in the future.

@dragon-archer
dragon-archer marked this pull request as ready for review August 12, 2026 17:00
@dragon-archer

Copy link
Copy Markdown
Collaborator Author

BTW, running

LANG=C pacman -Si | grep -E '^(Name|Depends On)' | awk '/^Name/ {name=$3} /^Depends On/ && /gcc-libs/ {print name}'

shows that there're lots of (11 for MINGW32, 150+ for MINGW64 and UCRT64) packages that haven't been rebuilt after switching from gcc-libs to cc-libs.

I suggest rebuilding all these packages in batches.

Keep gcc-libs as a compatibility package that depends on the new
cc-libs metapackage and libgomp.

The previous split (msys2#28751) moved the omp provision from gcc-libs to
libgomp without retaining a dependency edge between them. During a
system upgrade, the old gcc-libs package had to be removed because the
split runtime packages took ownership of its files. This also removed
the only installed omp provider.

Although libgomp provides omp, pacman only searches for providers while
resolving forward dependencies of packages already selected for the
transaction. The missing omp dependency was detected later, during the
final reverse-dependency validation. That validation reports broken
dependencies but does not add new provider packages to the transaction,
so libgomp was never selected automatically.

Add a concrete cc-libs package for the common GCC runtime libraries and
turn gcc-libs into a compatibility package depending on matching
versions of cc-libs and libgomp. Upgrading the installed gcc-libs
package now pulls libgomp into the transaction before reverse-dependency
validation, preserving all existing omp dependencies.

Keeping libgomp outside cc-libs also allows new common-runtime consumers
to avoid installing the OpenMP runtime when it is not required.

Move the tzdata dependency to libstdc++, which is the component using
the C++ time-zone database.
@dragon-archer

Copy link
Copy Markdown
Collaborator Author

@lazka @MehdiChinoune Any comments?

@dragon-archer

Copy link
Copy Markdown
Collaborator Author

@lazka @MehdiChinoune Any comments?

Ping.

@dragon-archer

Copy link
Copy Markdown
Collaborator Author

@lazka @MehdiChinoune Any comments?

Ping.

@lazka @MehdiChinoune Ping^2.

@lazka

lazka commented Aug 26, 2026

Copy link
Copy Markdown
Member

I'll try to have a look...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants