4.0.4-alt105 A BRP check that would check that the resulting files have been compiled with flags which include all %optflags would help to see which packages have problems with honoring %optflags. This would warn the maintainers that their attention is needed to fix this before someone changes %optflags to rebuild packages differently en masse (on another platform or with a different mechanism for passing %optflags to the compiler as in https://bugzilla.altlinux.org/show_bug.cgi?id=34161 ). bircoph@ had this idea and suggested to use a special GCC flag to record the actually used flags in the resulting files.
(In reply to comment #0) > bircoph@ had this idea and suggested to use a special GCC flag to record the > actually used flags in the resulting files. The option is called -frecord-gcc-switches; it adds .GCC.command.line section in each generated ELF file. These sections have the same type (PROGBITS) and flags (MERGE, STRINGS) as .comment sections. Like .comment sections, .GCC.command.line sections are moved to .debug files by debugedit.
rpm-build: Sun Jan 07 2018 Dmitry V. Levin <ldv@altlinux> 4.0.4-alt107 - compare_deps: fixed a bug in handling epochs. - platform.in: + %optflags_core: added -frecord-gcc-switches (see: #34162); + %make_build: implemented as a simple command (closes: #34237). - genCpioListAndHeader: implemented remapping of device and inode numbers (by Vladimir D. Seleznev and me; closes: #34398).
А как теперь поступать с такой ошибкой при сборке: "/usr/bin/clang" is not able to compile a simple test program. It fails with the following output: clang-6.0: error: unknown argument: '-frecord-gcc-switches'
(In reply to comment #3) > А как теперь поступать с такой ошибкой при сборке: > > "/usr/bin/clang" > > is not able to compile a simple test program. > > It fails with the following output: > > clang-6.0: error: unknown argument: '-frecord-gcc-switches' не передавать -frecord-gcc-switches в clang? не использовать clang?
(В ответ на комментарий №4) ... > не передавать -frecord-gcc-switches в clang? > не использовать clang? Хороший совет, но по строке changelog + %optflags_core: added -frecord-gcc-switches (see: #34162); я ожидал хоть где-то найти его, чтобы не передавать, но $ rpm --showrc | grep optflags_core -14: optflags_core -pipe А... Ах вот оно что... $ rpmbuild --showrc | grep optflags_core -14: optflags_core -pipe -frecord-gcc-switches А точно нельзя, чтобы команда rpm --showrc выдавала те же макросы, или не работала бы вообще. А то я теперь даже не знаю, откуда она берёт свой вывод.
(В ответ на комментарий №4) ... > не передавать -frecord-gcc-switches в clang? так и сделаю, спасибо: %remove_optflags -frecord-gcc-switches
FYI: `%remove_optflags -frecord-gcc-switches` не нужен начиная с clang8.