Re: [Xen-devel] [PATCH v2] xen/x86: fix linker script to work with lld
On Wed, Jul 11, 2018 at 01:46:56PM +0200, Roger Pau Monné wrote: > On Wed, Jul 11, 2018 at 12:42:48PM +0200, Daniel Kiper wrote: > > On Wed, Jul 11, 2018 at 12:25:21PM +0200, Roger Pau Monne wrote: > > > lld (the llvm linker) has some issues with Xen linker script. It > > > doesn't understand '||' in assert expressions: > > > > > > ld-melf_x86_64_fbsd -T xen.lds -N prelink.o --build-id=sha1 \ > > > /root/src/xen/xen/common/symbols-dummy.o -o > > > /root/src/xen/xen/.xen-syms.0 > > > ld: error: xen.lds:260: malformed number: | > > > >>> ASSERT(__image_base__ > (261 >> 8) * 0x) | > > > >>> (261 << 39))) + ((1 << 39) / 2)) + (64 << 30)) + (1 << 30)) + (1 << > > > >>> 30))) || > > > >>> > > > >>> > > > >>> ^ > > > > > > And doesn't work properly with the 'DEFINED(foo) ? foo : ...' > > > expression: > > > > > > ld-melf_x86_64_fbsd -T xen.lds -N prelink.o --build-id=sha1 \ > > > /root/src/xen/xen/common/symbols-dummy.o -o > > > /root/src/xen/xen/.xen-syms.0 > > > ld: error: xen.lds:233: symbol not found: efi > > > > > > Fix the first issue by using '|' instead of '||', and the second one > > > by declaring the efi symbol as a weak symbol. > > > > > > Signed-off-by: Roger Pau Monné > > > --- > > > Cc: Jan Beulich > > > Cc: Andrew Cooper > > > Cc: Daniel Kiper > > > --- > > > Changes since v1: > > > - Export efi as a weak symbol in order to remove the DEFINED > > >conditional in the linker script. > > > - Add a define for setting the weak attribute and replace existing > > >users. > > > > May I ask you to split this patch into two separate patches? > > One for __weak change and one for DEFINED() drop please. > > So to introduce and use __weak also for the efi variable and then drop > the DEFINED in a following patch? > > Or switch efi to use __weak in the same patch where DEFINED is > dropped? The latter please. Daniel ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH v2] xen/x86: fix linker script to work with lld
On Wed, Jul 11, 2018 at 12:42:48PM +0200, Daniel Kiper wrote: > On Wed, Jul 11, 2018 at 12:25:21PM +0200, Roger Pau Monne wrote: > > lld (the llvm linker) has some issues with Xen linker script. It > > doesn't understand '||' in assert expressions: > > > > ld-melf_x86_64_fbsd -T xen.lds -N prelink.o --build-id=sha1 \ > > /root/src/xen/xen/common/symbols-dummy.o -o > > /root/src/xen/xen/.xen-syms.0 > > ld: error: xen.lds:260: malformed number: | > > >>> ASSERT(__image_base__ > (261 >> 8) * 0x) | (261 > > >>> << 39))) + ((1 << 39) / 2)) + (64 << 30)) + (1 << 30)) + (1 << 30))) || > > >>> > > >>> ^ > > > > And doesn't work properly with the 'DEFINED(foo) ? foo : ...' > > expression: > > > > ld-melf_x86_64_fbsd -T xen.lds -N prelink.o --build-id=sha1 \ > > /root/src/xen/xen/common/symbols-dummy.o -o > > /root/src/xen/xen/.xen-syms.0 > > ld: error: xen.lds:233: symbol not found: efi > > > > Fix the first issue by using '|' instead of '||', and the second one > > by declaring the efi symbol as a weak symbol. > > > > Signed-off-by: Roger Pau Monné > > --- > > Cc: Jan Beulich > > Cc: Andrew Cooper > > Cc: Daniel Kiper > > --- > > Changes since v1: > > - Export efi as a weak symbol in order to remove the DEFINED > >conditional in the linker script. > > - Add a define for setting the weak attribute and replace existing > >users. > > May I ask you to split this patch into two separate patches? > One for __weak change and one for DEFINED() drop please. So to introduce and use __weak also for the efi variable and then drop the DEFINED in a following patch? Or switch efi to use __weak in the same patch where DEFINED is dropped? Roger. ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH v2] xen/x86: fix linker script to work with lld
On Wed, Jul 11, 2018 at 12:25:21PM +0200, Roger Pau Monne wrote: > lld (the llvm linker) has some issues with Xen linker script. It > doesn't understand '||' in assert expressions: > > ld-melf_x86_64_fbsd -T xen.lds -N prelink.o --build-id=sha1 \ > /root/src/xen/xen/common/symbols-dummy.o -o /root/src/xen/xen/.xen-syms.0 > ld: error: xen.lds:260: malformed number: | > >>> ASSERT(__image_base__ > (261 >> 8) * 0x) | (261 > >>> << 39))) + ((1 << 39) / 2)) + (64 << 30)) + (1 << 30)) + (1 << 30))) || > >>> > >>> ^ > > And doesn't work properly with the 'DEFINED(foo) ? foo : ...' > expression: > > ld-melf_x86_64_fbsd -T xen.lds -N prelink.o --build-id=sha1 \ > /root/src/xen/xen/common/symbols-dummy.o -o /root/src/xen/xen/.xen-syms.0 > ld: error: xen.lds:233: symbol not found: efi > > Fix the first issue by using '|' instead of '||', and the second one > by declaring the efi symbol as a weak symbol. > > Signed-off-by: Roger Pau Monné > --- > Cc: Jan Beulich > Cc: Andrew Cooper > Cc: Daniel Kiper > --- > Changes since v1: > - Export efi as a weak symbol in order to remove the DEFINED >conditional in the linker script. > - Add a define for setting the weak attribute and replace existing >users. May I ask you to split this patch into two separate patches? One for __weak change and one for DEFINED() drop please. Daniel ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel