hsdis perhaps also need to be linked with -z noexecstack for JDK-8201398

Ao Qi aoqi at loongson.cn
Mon Aug 13 12:44:45 UTC 2018


Florian Weimer <fweimer at redhat.com> 于2018年8月13日周一 下午7:18写道:
>
> On 08/13/2018 06:58 AM, Leslie Zhai wrote:
>
> > So I just add nonexecstack flag set for linking with binutils/ld and
> > test it for mips64el:
> >
> > diff -r a57483d08d95 src/share/tools/hsdis/Makefile
> > --- a/src/share/tools/hsdis/Makefile    Fri Aug 10 08:29:53 2018 -0700
> > +++ b/src/share/tools/hsdis/Makefile    Mon Aug 13 12:51:01 2018 +0800
> > @@ -104,12 +104,19 @@
> >   endif
> >   CFLAGS        += $(CFLAGS/$(ARCH))
> >   CFLAGS        += -fPIC
> > +ifeq ($(ARCH), mips64)
> > +CPUINFO = $(shell cat /proc/cpuinfo)
> > +ifneq ($(findstring Loongson,$(CPUINFO)),)
> > +CFLAGS += -DLOONGSON
> > +endif
> > +endif
>
> That really can't be correct—the build environment isn't necessarily the
> same as the execution environment.

The complete patch was here:
http://hg.loongnix.org/jdk8-mips64-public/hotspot/rev/1d33944924b0
This patch is to build hsdis-mips64.so for mips64 and loongson.
Because Loongson CPUs have some instructions which MIPS64 do not have,
I separated the situation of Loongson and MIPS64.
I think this change is not necessary to solve the problem Leslie Zhai
wants to solve.

Thanks,
Ao Qi

>
> >   OS        = linux
> >   LIB_EXT        = .so
> >   CC         = gcc
> >   endif
> >   CFLAGS        += -O
> >   DLDFLAGS    += -shared
> > +DLDFLAGS        += -Wl,-z,noexecstack
> >   LDFLAGS         += -ldl
> >   OUTFLAGS    += -o $@
> >   else
>
> Could this be a toolchain issue?  Does your port use soft-float?
>
> Thanks,
> Florian


More information about the jdk8u-dev mailing list