hsdis perhaps also need to be linked with -z noexecstack for JDK-8201398
Leslie Zhai
zhaixiang at loongson.cn
Tue Aug 14 02:08:34 UTC 2018
Hi Florian,
Thanks for your response!
在 2018年08月13日 19:18, Florian Weimer 写道:
> 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.
Sorry for my poor English. Ao Qi point out the key point: this change is
not necessary to solve the problem what I want to solve.
http://mail.openjdk.java.net/pipermail/jdk8u-dev/2018-August/007756.html
But workaround for mips64el's PrintLIRWithAssembly is adding
-Wl,-z,noexecstack linking flag, strangely X86 does *not* need such
flag, so I am investigating the root cause.
>
>
>> 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?
Perhaps it is not GCC toolchain issue. We use it to build[1] Linux
Kernel, OpenJDK and even LLVM.
And it does *not* use soft-float, it is able to use
$ rpm -ivh gcc-4.9.3-8.fc21.loongson.8.src.rpm[2]
There is *no* --with-float=soft/hard in the gcc.spec file.
1.
Kernel http://lists.llvm.org/pipermail/llvm-dev/2018-July/124620.html
OpenJDK http://lists.llvm.org/pipermail/llvm-dev/2018-July/124717.html
LLVM http://lists.llvm.org/pipermail/llvm-dev/2018-August/125190.html
2.
http://ftp.loongnix.org/os/loongnix/1.0/SRPMS/g/gcc-4.9.3-8.fc21.loongson.8.src.rpm
>
>
> Thanks,
> Florian
--
Regards,
Leslie Zhai
More information about the jdk8u-dev
mailing list