All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: Nicholas Piggin <npiggin@gmail.com>
Cc: Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
	Chris Metcalf <cmetcalf@mellanox.com>
Subject: Re: [PATCH v2 3/3] tile: thin archives fix linking
Date: Sun, 25 Jun 2017 12:28:43 +0900	[thread overview]
Message-ID: <CAK7LNATU6=90_uUTZZAj1hsX8hvJ7w-Lb0T4gXiqyWwMomYimw@mail.gmail.com> (raw)
In-Reply-To: <20170622123929.15054-4-npiggin@gmail.com>

2017-06-22 21:39 GMT+09:00 Nicholas Piggin <npiggin@gmail.com>:
> The VDSO symbols can't be linked into built-in.o when building with
> thin archives, so change this to linking a new object file that is
> included into the built-in.o.
>
> Cc: Chris Metcalf <cmetcalf@mellanox.com>
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> ---
>  arch/tile/kernel/vdso/Makefile | 14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/arch/tile/kernel/vdso/Makefile b/arch/tile/kernel/vdso/Makefile
> index c54fff37b5ff..e140472d5be6 100644
> --- a/arch/tile/kernel/vdso/Makefile
> +++ b/arch/tile/kernel/vdso/Makefile
> @@ -11,7 +11,7 @@ obj-vdso := $(addprefix $(obj)/, $(obj-vdso))
>  # vdso32 is only for tilegx -m32 compat task.
>  VDSO32-$(CONFIG_COMPAT) := y
>
> -obj-y += vdso.o
> +obj-y += vdso.o vdso-syms.o
>  obj-$(VDSO32-y) += vdso32.o
>  extra-y += vdso.lds
>  CPPFLAGS_vdso.lds += -P -C -U$(ARCH)
> @@ -49,16 +49,18 @@ $(obj)/vdso.so.dbg: $(src)/vdso.lds $(obj-vdso)
>  # We also create a special relocatable object that should mirror the symbol
>  # table and layout of the linked DSO.  With ld -R we can then refer to
>  # these symbols in the kernel code rather than hand-coded addresses.
> -extra-y += vdso-syms.o
> -$(obj)/built-in.o: $(obj)/vdso-syms.o
> -$(obj)/built-in.o: ld_flags += -R $(obj)/vdso-syms.o
>
>  SYSCFLAGS_vdso.so.dbg = -shared -s -Wl,-soname=linux-vdso.so.1 \
>                              $(call cc-ldoption, -Wl$(comma)--hash-style=both)
> -SYSCFLAGS_vdso_syms.o = -r
> -$(obj)/vdso-syms.o: $(src)/vdso.lds $(obj)/vrt_sigreturn.o FORCE
> +SYSCFLAGS_vdso_dummy.o = -r
> +$(obj)/vdso-dummy.o: $(src)/vdso.lds $(obj)/vrt_sigreturn.o FORCE
>         $(call if_changed,vdsold)
>
> +quiet_cmd_vdso_sym = VDSOSYM $@
> +      cmd_vdso_sym = $(LD) -r -R $(obj)/vdso-dummy.o -o $@
> +
> +$(obj)/vdso-syms.o: $(obj)/vdso-dummy.o
> +       $(call if_changed,vdso_sym)
>
>  # strip rule for the .so file
>  $(obj)/%.so: OBJCOPYFLAGS := -S
> --
> 2.11.0
>
> --

I updated thin-ar branch.

Just in case, the following is my local fix-up:

 - Fix incremental build
 - Do not repeat "$(obj)/vsyscall-dummy.o" in the build command



diff --git a/arch/tile/kernel/vdso/Makefile b/arch/tile/kernel/vdso/Makefile
index edb7809..c615ec0 100644
--- a/arch/tile/kernel/vdso/Makefile
+++ b/arch/tile/kernel/vdso/Makefile
@@ -5,7 +5,7 @@ vdso-syms = rt_sigreturn gettimeofday
 obj-vdso = $(patsubst %, v%.o, $(vdso-syms))

 # Build rules
-targets := $(obj-vdso) vdso.so vdso.so.dbg vdso.lds
+targets := $(obj-vdso) vdso.so vdso.so.dbg vdso.lds vdso-dummy.o
 obj-vdso := $(addprefix $(obj)/, $(obj-vdso))

 # vdso32 is only for tilegx -m32 compat task.
@@ -56,9 +56,9 @@ $(obj)/vdso-dummy.o: $(src)/vdso.lds
$(obj)/vrt_sigreturn.o FORCE
        $(call if_changed,vdsold)

 quiet_cmd_vdso_sym = VDSOSYM $@
-      cmd_vdso_sym = $(LD) -r -R $(obj)/vdso-dummy.o -o $@
+      cmd_vdso_sym = $(LD) -r -o $@ -R $<

-$(obj)/vdso-syms.o: $(obj)/vdso-dummy.o
+$(obj)/vdso-syms.o: $(obj)/vdso-dummy.o FORCE
        $(call if_changed,vdso_sym)

 # strip rule for the .so file



-- 
Best Regards
Masahiro Yamada

  reply	other threads:[~2017-06-25  3:28 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-22 12:39 [PATCH v2 0/3] fix ia64, tile, sh for thin archives Nicholas Piggin
2017-06-22 12:39 ` [PATCH v2 1/3] sh: thin archives fix linking Nicholas Piggin
2017-06-22 12:39   ` Nicholas Piggin
2017-06-23  3:25   ` Masahiro Yamada
2017-06-23  3:25     ` Masahiro Yamada
2017-06-23  3:50     ` Nicholas Piggin
2017-06-23  3:50       ` Nicholas Piggin
2017-06-23 10:02       ` Masahiro Yamada
2017-06-23 10:02         ` Masahiro Yamada
2017-06-25  3:24         ` Masahiro Yamada
2017-06-25  3:24           ` Masahiro Yamada
2017-06-22 12:39 ` [PATCH v2 2/3] ia64: " Nicholas Piggin
2017-06-22 12:39   ` Nicholas Piggin
2017-06-23  9:56   ` Masahiro Yamada
2017-06-23  9:56     ` Masahiro Yamada
2017-06-23 13:44     ` Nicholas Piggin
2017-06-23 13:44       ` Nicholas Piggin
2017-06-25  3:26       ` Masahiro Yamada
2017-06-25  3:26         ` Masahiro Yamada
2017-06-22 12:39 ` [PATCH v2 3/3] tile: " Nicholas Piggin
2017-06-25  3:28   ` Masahiro Yamada [this message]
2017-06-25  5:23     ` Nicholas Piggin
2017-06-23  3:23 ` [PATCH v2 0/3] fix ia64, tile, sh for thin archives Masahiro Yamada
2017-06-23  3:42   ` Nicholas Piggin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAK7LNATU6=90_uUTZZAj1hsX8hvJ7w-Lb0T4gXiqyWwMomYimw@mail.gmail.com' \
    --to=yamada.masahiro@socionext.com \
    --cc=cmetcalf@mellanox.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=npiggin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.