Bug 36382

Summary: extlinux-6.04.pre1-alt1.5e426532 builds its own copy of zlib
Product: Sisyphus Reporter: Dmitry V. Levin <ldv>
Component: extlinuxAssignee: Alexey Gladkov <legion>
Status: CLOSED NOTABUG QA Contact: qa-sisyphus
Severity: normal    
Priority: P3 CC: legion
Version: unstable   
Hardware: all   
OS: Linux   

Description Dmitry V. Levin 2019-03-25 20:15:46 MSK
$ grep -Fc /com32/lib/zlib/ beehive/logs/Sisyphus-x86_64/latest/success/extlinux-6.04.pre1-alt1.5e426532
53

$ comm -12 <(/usr/lib/rpm/provided_symbols /lib64/libz.so.1 |sort) \
<(/usr/lib/rpm/provided_symbols /boot/extlinux/libcom32.c32 |sort)
adler32
adler32_combine
adler32_combine64
compress
compress2
compressBound
crc32
crc32_combine
crc32_combine64
deflate
deflateBound
deflateCopy
deflateEnd
deflateInit_
deflateInit2_
deflateParams
deflatePrime
deflateReset
deflateSetDictionary
deflateSetHeader
deflateTune
get_crc_table
inflate
inflateBack
inflateBackEnd
inflateBackInit_
inflateCopy
inflateEnd
inflateGetHeader
inflateInit_
inflateInit2_
inflateMark
inflatePrime
inflateReset
inflateReset2
inflateSetDictionary
inflateSync
inflateSyncPoint
inflateUndermine
uncompress
zError
zlibCompileFlags
zlibVersion
Comment 1 Alexey Gladkov 2019-03-25 20:37:21 MSK
Yes. This code is executed before the kernel is loaded. It cannot be linked with dynamic libraries.
Comment 2 Dmitry V. Levin 2019-03-25 20:40:08 MSK
(In reply to comment #1)
> Yes. This code is executed before the kernel is loaded. It cannot be linked
> with dynamic libraries.

What about linking with zlib.a?
Comment 3 Alexey Gladkov 2019-03-25 21:09:32 MSK
(In reply to comment #2)
> What about linking with zlib.a?

They have not only zlib:

https://repo.or.cz/syslinux.git/tree/05ac953c23f90b2328d393f7eecde96e41aed067:/com32/lib/zlib
https://repo.or.cz/syslinux.git/tree/05ac953c23f90b2328d393f7eecde96e41aed067:/com32/lib/libpng

BTW I can see that they changed this code:

https://repo.or.cz/syslinux.git/history/HEAD:/com32/lib/zlib

I see no point in linking this code with static zlib and libpng. It runs on another level than kernel or everything else in the system.
Comment 4 Dmitry V. Levin 2019-03-25 21:47:44 MSK
(In reply to comment #3)
> (In reply to comment #2)
> > What about linking with zlib.a?
> 
> They have not only zlib:
> 
> https://repo.or.cz/syslinux.git/tree/05ac953c23f90b2328d393f7eecde96e41aed067:/com32/lib/zlib
> https://repo.or.cz/syslinux.git/tree/05ac953c23f90b2328d393f7eecde96e41aed067:/com32/lib/libpng
> 
> BTW I can see that they changed this code:
> 
> https://repo.or.cz/syslinux.git/history/HEAD:/com32/lib/zlib

It's the same code as zlib v1.2.11 with some files removed.

> I see no point in linking this code with static zlib and libpng. It runs on
> another level than kernel or everything else in the system.

Could you at least make these zlib symbols hidden?
Comment 5 Alexey Gladkov 2019-03-25 22:21:22 MSK
(In reply to comment #4)
> > I see no point in linking this code with static zlib and libpng. It runs on
> > another level than kernel or everything else in the system.
> 
> Could you at least make these zlib symbols hidden?

Why ?

All that is below the /boot/extlinux can't be verified for unresolved symbols as well. We agreed that these files will be ignored by any distro checks.
Comment 6 Dmitry V. Levin 2019-03-25 22:32:57 MSK
(In reply to comment #5)
> (In reply to comment #4)
> > > I see no point in linking this code with static zlib and libpng. It runs on
> > > another level than kernel or everything else in the system.
> > 
> > Could you at least make these zlib symbols hidden?
> 
> Why ?

Because you can.
I wish I could change the default in gcc to generate all symbols as hidden.

> All that is below the /boot/extlinux can't be verified for unresolved symbols
> as well. We agreed that these files will be ignored by any distro checks.

I don't see any signs of it in the code.
Comment 7 Alexey Gladkov 2019-03-25 22:48:05 MSK
(In reply to comment #6)
> > Why ?
> 
> Because you can.
> I wish I could change the default in gcc to generate all symbols as hidden.

Я могу попробовать, но не обещаю. Я очень не хочу этот код сломать изменениями ради изменений. Если он тебе мешает, то удаляй его из сизифа. Я буду его использовать вне репозитория.

> > All that is below the /boot/extlinux can't be verified for unresolved symbols
> > as well. We agreed that these files will be ignored by any distro checks.
> 
> I don't see any signs of it in the code.

Дим, да ты чего ? Мы же с тобой отдельно расследовали это, когда я выкладывал extlinux-6 и когда он не мог пройти сборочницу из-за того что апстрим перешёл на ELF.
Comment 8 Dmitry V. Levin 2019-03-25 22:57:57 MSK
(In reply to comment #7)
> (In reply to comment #6)
> > > Why ?
> > 
> > Because you can.
> > I wish I could change the default in gcc to generate all symbols as hidden.
> 
> Я могу попробовать, но не обещаю. Я очень не хочу этот код сломать изменениями
> ради изменений. Если он тебе мешает, то удаляй его из сизифа. Я буду его
> использовать вне репозитория.

Тебе же будет лучше, если zlib не будет из него светиться.

> > > All that is below the /boot/extlinux can't be verified for unresolved symbols
> > > as well. We agreed that these files will be ignored by any distro checks.
> > 
> > I don't see any signs of it in the code.
> 
> Дим, да ты чего ? Мы же с тобой отдельно расследовали это, когда я выкладывал
> extlinux-6 и когда он не мог пройти сборочницу из-за того что апстрим перешёл
> на ELF.

Значит, я тогда сделал какое-то временное решение, которое никуда не закоммичено.  Плохо.
Comment 9 Alexey Gladkov 2019-03-25 23:05:36 MSK
(In reply to comment #8)
> > Я могу попробовать, но не обещаю. Я очень не хочу этот код сломать изменениями
> > ради изменений. Если он тебе мешает, то удаляй его из сизифа. Я буду его
> > использовать вне репозитория.
> 
> Тебе же будет лучше, если zlib не будет из него светиться.

С чего мне будет лучше ? Это никак не влияет на функционал. Это только заткнёт ещё одну userspace проверку разве что.

> > Дим, да ты чего ? Мы же с тобой отдельно расследовали это, когда я выкладывал
> > extlinux-6 и когда он не мог пройти сборочницу из-за того что апстрим перешёл
> > на ELF.
> 
> Значит, я тогда сделал какое-то временное решение, которое никуда не
> закоммичено.  Плохо.

$ diff -u /usr/lib64/perl5/qa/rpmelfsym.pm{~,}                                                                                              
--- /usr/lib64/perl5/qa/rpmelfsym.pm~                                                                                                       
+++ /usr/lib64/perl5/qa/rpmelfsym.pm                                                                                                        
@@ -33,6 +33,7 @@                                                                                                                           
                $filename =~ s#^\./|^/|^#/#;                                                                                                
                                                                                                                                            
                next if $filename =~ m#^/usr/lib/debug/.+\.debug\z#;                                                                        
+               next if $filename =~ /^\/boot\//;                                                                                           
                                                                                                                                            
                $ent->read(my $magic, 4) == 4                                                                                               
                        or die "$rpm: $filename: cpio read failed"; 

Смотри наш тред "Re: [#197489] FAILED extlinux.git=6.03-alt1" от 26 декабря 2017.