Re: build failure when optimizing

2020-05-27 Thread Joerg Sonnenberger
On Wed, May 27, 2020 at 05:42:37PM +0200, Tobias Nygren wrote:
> There is an -mno-sse2 flag on the command line and it conflicts with
> your -mfpmath=sse flag. This COPTS setting comes from
> src/libexec/ld.elf_so/Makefile. You can remove the flag but expect
> random breakage, it is there for a reason. Probably the easiest fix is
> to add something like CFLAGS:=${CFLAGS:N-msse*:N-mfpmath=sse} at the
> bottom on the Makefile to undo your settings for this file only.

-mfpmath=sse is questionable anyway. It's one of those many flags found
in old Gentoo guides to magically make things faster, but (1) have a
good chance of doing the reverse (2) have a good chance of introducing
subtile regressions.

Joerg


Re: build failure when optimizing

2020-05-27 Thread Rin Okuyama

On 2020/05/28 0:42, Tobias Nygren wrote> There is an -mno-sse2 flag on the 
command line and it conflicts with

your -mfpmath=sse flag. This COPTS setting comes from
src/libexec/ld.elf_so/Makefile. You can remove the flag but expect
random breakage, it is there for a reason. Probably the easiest fix is
to add something like CFLAGS:=${CFLAGS:N-msse*:N-mfpmath=sse} at the
bottom on the Makefile to undo your settings for this file only.


This is why:

http://cvsweb.netbsd.org/bsdweb.cgi/src/libexec/ld.elf_so/Makefile#rev1.105


Disable use of various X86 extensions since _rtld_bind_start doesn't
save the necessary registers.


Thanks,
rin


Re: build failure when optimizing

2020-05-27 Thread Tobias Nygren
On Tue, 26 May 2020 23:01:36 +0200
os...@fessel.org wrote:

> Hej again,
> 
> > Am 24.05.2020 um 01:06 schrieb Tobias Nygren :
> > 
> > On Sat, 23 May 2020 22:25:55 +0200
> > os...@fessel.org wrote:
> > 
> >> I just tried to build release with optimisation for my little xeon server.
> >> That fails, but I don?t understand why it seems to build some 386 32bit 
> >> libs.
> > 
> > You can build with MKCOMPAT=no to avoid this problem if you don't need
> > 32-bit compatibility libs.
> 
> Thanks again, MKCOMPAT really is case-sensitive, so no is better than NO, but 
> nevertheless, im still not getting through the build process:
> 
> ?schnipp?
> 
> #   compile  ld.elf_so/mdreloc.o
> /hurz/obj/tooldir.NetBSD-9.99.63-amd64/bin/x86_64--netbsd-gcc -O2
> -mfpmath=sse -msse3 -march=native  -fvisibility=hidden -O3 
> -fomit-frame-pointer -mno-3dnow -mno-mmx -mno-sse -mno-sse2
> -mno-sse3 -fstack-protector -Wstack-protector   --param ssp-buffer-size=1
> -std=gnu99-Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 
> -Wno-sign-compare  -Wsystem-header
> s   -Wno-traditional   -Wa,--fatal-warnings  -Wreturn-type -Wswitch -Wshadow 
> -Wcast-qual -Wwrite-strings -Wextra -Wno-unused-parameter -Wno-sign-compare 
> -Wsign-compare -Wformat=2  -Wno-for
> mat-zero-length  -Werror --sysroot=/hurz/obj/destdir.NetBSD-9.99.64-amd64 
> -fPIC -DELFSIZE=64 -DRTLD_COMMON_CALL_IFUNC_RELA -DLIBDIR=\"/usr/lib\" 
> -D_PATH_RTLD=\"/libexec/ld.elf_so\" -I/
> hurz/src/libexec/ld.elf_so -I. -D_KERNTYPES -DRTLD_LOADER -DGNU_RELRO 
> -D_RTLD_SOURCE -DHAVE_INITFINI_ARRAY  -D_FORTIFY_SOURCE=2 -c
> /hurz/src/libexec/ld.elf_so/arch/x86_64/mdreloc.c
> cc1: error: SSE instruction set disabled, using 387 arithmetics [-Werror]
> cc1: all warnings being treated as errors
> 
> *** Failed target:  mdreloc.o
> ?schnapp?
> 
> how comes?  And what can I do?

There is an -mno-sse2 flag on the command line and it conflicts with
your -mfpmath=sse flag. This COPTS setting comes from
src/libexec/ld.elf_so/Makefile. You can remove the flag but expect
random breakage, it is there for a reason. Probably the easiest fix is
to add something like CFLAGS:=${CFLAGS:N-msse*:N-mfpmath=sse} at the
bottom on the Makefile to undo your settings for this file only.


Re: build failure when optimizing

2020-05-26 Thread Robert Swindells


os...@fessel.org wrote:
> Am 24.05.2020 um 01:06 schrieb Tobias Nygren :
> 
> On Sat, 23 May 2020 22:25:55 +0200
> os...@fessel.org wrote:
> 
>> I just tried to build release with optimisation for my little xeon server.
>> That fails, but I don?t understand why it seems to build some 386 32bit libs.
> 
> You can build with MKCOMPAT=no to avoid this problem if you don't need
> 32-bit compatibility libs.

>Thanks again, MKCOMPAT really is case-sensitive, so no is better than
>NO, but nevertheless, im still not getting through the build process:

[snip]

>how comes?  And what can I do?

You could just use the default compiler settings, I wouldn't expect it
to make much difference on x86_64.

Maybe try this (not tested):

Index: Makefile
===
RCS file: /cvsroot/src/libexec/ld.elf_so/Makefile,v
retrieving revision 1.143
diff -u -r1.143 Makefile
--- Makefile9 Feb 2020 09:11:59 -   1.143
+++ Makefile26 May 2020 21:31:22 -
@@ -51,7 +51,7 @@
 LDFLAGS+=  -Wl,--warn-shared-textrel
 LDFLAGS+=  -Wl,-Map=${.TARGET}.map
 
-COPTS+=-fvisibility=hidden
+COPTS= -fvisibility=hidden
 
 # Adds SRCS, CPPFLAGS, LDFLAGS, etc.  Must go first so MD startup source
 # is first.


Re: build failure when optimizing

2020-05-26 Thread oskar
Hej again,

> Am 24.05.2020 um 01:06 schrieb Tobias Nygren :
> 
> On Sat, 23 May 2020 22:25:55 +0200
> os...@fessel.org wrote:
> 
>> I just tried to build release with optimisation for my little xeon server.
>> That fails, but I don?t understand why it seems to build some 386 32bit libs.
> 
> You can build with MKCOMPAT=no to avoid this problem if you don't need
> 32-bit compatibility libs.

Thanks again, MKCOMPAT really is case-sensitive, so no is better than NO, but 
nevertheless, im still not getting through the build process:

—schnipp—

#   compile  ld.elf_so/mdreloc.o
/hurz/obj/tooldir.NetBSD-9.99.63-amd64/bin/x86_64--netbsd-gcc -O2
-mfpmath=sse -msse3 -march=native  -fvisibility=hidden -O3 -fomit-frame-pointer 
-mno-3dnow -mno-mmx -mno-sse -mno-sse2
-mno-sse3 -fstack-protector -Wstack-protector   --param ssp-buffer-size=1
-std=gnu99-Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 
-Wno-sign-compare  -Wsystem-header
s   -Wno-traditional   -Wa,--fatal-warnings  -Wreturn-type -Wswitch -Wshadow 
-Wcast-qual -Wwrite-strings -Wextra -Wno-unused-parameter -Wno-sign-compare 
-Wsign-compare -Wformat=2  -Wno-for
mat-zero-length  -Werror --sysroot=/hurz/obj/destdir.NetBSD-9.99.64-amd64 
-fPIC -DELFSIZE=64 -DRTLD_COMMON_CALL_IFUNC_RELA -DLIBDIR=\"/usr/lib\" 
-D_PATH_RTLD=\"/libexec/ld.elf_so\" -I/
hurz/src/libexec/ld.elf_so -I. -D_KERNTYPES -DRTLD_LOADER -DGNU_RELRO 
-D_RTLD_SOURCE -DHAVE_INITFINI_ARRAY  -D_FORTIFY_SOURCE=2 -c
/hurz/src/libexec/ld.elf_so/arch/x86_64/mdreloc.c
cc1: error: SSE instruction set disabled, using 387 arithmetics [-Werror]
cc1: all warnings being treated as errors

*** Failed target:  mdreloc.o
—schnapp—

how comes?  And what can I do?

Cheers
Oskar


signature.asc
Description: Message signed with OpenPGP


Re: build failure when optimizing

2020-05-23 Thread Tobias Nygren
On Sat, 23 May 2020 22:25:55 +0200
os...@fessel.org wrote:

> I just tried to build release with optimisation for my little xeon server.
> That fails, but I don?t understand why it seems to build some 386 32bit libs.

You can build with MKCOMPAT=no to avoid this problem if you don't need
32-bit compatibility libs.

-Tobias


Re: build failure when optimizing

2020-05-23 Thread oskar
Hej,

> Am 23.05.2020 um 23:21 schrieb Paul Goyette :
> 
> This is done deliberately, to enable you to run NetBSD-i386 images on
> a NetBSD-amd64 host.
> 
> If you want to eliminate these compatability libraries, you can set
> the MKCOMPAT variable to NO:
> 
>   build.sh ... -V MKCOMPAT=NO release

Cool, thanks. 
seems like that was the default in netbsd 8.1 and earlier, looking at my old 
logs.

Probably a „not-reading-all-release-notes“ error.

Cheers
Oskar

smime.p7s
Description: S/MIME cryptographic signature


Re: build failure when optimizing

2020-05-23 Thread Paul Goyette

This is done deliberately, to enable you to run NetBSD-i386 images on
a NetBSD-amd64 host.

If you want to eliminate these compatability libraries, you can set
the MKCOMPAT variable to NO:

build.sh ... -V MKCOMPAT=NO release


On Sat, 23 May 2020, os...@fessel.org wrote:


Hej,

I just tried to build release with optimisation for my little xeon server.
That fails, but I don???t understand why it seems to build some 386 32bit libs.
???
# build  libgcc_s/libgcc_s.so.1.0
rm -f libgcc_s.so.1.0
/hurz/obj/tooldir.NetBSD-9.99.63-amd64/bin/x86_64--netbsd-gcc -nodefaultlibs 
-shared -Wl,-soname,libgcc_s.so.1  -Wl,--warn-shared-textrel 
-Wl,-Map=libgcc_s.so.1.map   -m32 
--sysroot=/hurz/obj/destdir.NetBSD-9.99.63-amd64 -nodefaultlibs -Wl,-z 
-Wl,nodelete 
-Wl,--version-script=/hurz/src/external/gpl3/gcc/lib/libgcc/libgcc_s/libgcc.map 
-Wl,-z,relro  -o libgcc_s.so.1.0.tmp  -Wl,-rpath,/usr/lib/i386  
-L=/usr/lib/i386 -Wl,-x  -Wl,--whole-archive libgcc_s_pic.a  
-Wl,--no-whole-archive -m32
/hurz/obj/tooldir.NetBSD-9.99.63-amd64/lib/gcc/x86_64--netbsd/8.4.0/../../../../x86_64--netbsd/bin/ld:
 i386:x86-64 architecture of input file 
`/hurz/obj/destdir.NetBSD-9.99.63-amd64/usr/lib/../lib/i386/crti.o' is 
incompatible with i386 output
???
optimization was done using cpuflags:
ARCH: -march=native
FEATURES: -mfpmath=sse -msse3
CPUFLAGS: -mfpmath=sse -msse3 -march=native
GCC version : 8.4.0
OS  : 'NetBSD'
OS version  : '9.99.63'
hw.model: 'Intel 686-class'
hw.machine  : 'amd64'
hw.machine_arch : 'x86_64'
CPU : ''
cpu_name="highest basic info 000d"
cpu_brand="IntelR XeonR CPU E5-2640 0 @ 2.50GHz???

Any ideas?

cheers
Oskar




++--+---+
| Paul Goyette   | PGP Key fingerprint: | E-mail addresses: |
| (Retired)  | FA29 0E3B 35AF E8AE 6651 | p...@whooppee.com |
| Software Developer | 0786 F758 55DE 53BA 7731 | pgoye...@netbsd.org   |
++--+---+

build failure when optimizing

2020-05-23 Thread oskar
Hej,

I just tried to build release with optimisation for my little xeon server.
That fails, but I don’t understand why it seems to build some 386 32bit libs.
—
# build  libgcc_s/libgcc_s.so.1.0
rm -f libgcc_s.so.1.0
/hurz/obj/tooldir.NetBSD-9.99.63-amd64/bin/x86_64--netbsd-gcc -nodefaultlibs 
-shared -Wl,-soname,libgcc_s.so.1  -Wl,--warn-shared-textrel 
-Wl,-Map=libgcc_s.so.1.map   -m32 
--sysroot=/hurz/obj/destdir.NetBSD-9.99.63-amd64 -nodefaultlibs -Wl,-z 
-Wl,nodelete 
-Wl,--version-script=/hurz/src/external/gpl3/gcc/lib/libgcc/libgcc_s/libgcc.map 
-Wl,-z,relro  -o libgcc_s.so.1.0.tmp  -Wl,-rpath,/usr/lib/i386  
-L=/usr/lib/i386 -Wl,-x  -Wl,--whole-archive libgcc_s_pic.a  
-Wl,--no-whole-archive -m32 
/hurz/obj/tooldir.NetBSD-9.99.63-amd64/lib/gcc/x86_64--netbsd/8.4.0/../../../../x86_64--netbsd/bin/ld:
 i386:x86-64 architecture of input file 
`/hurz/obj/destdir.NetBSD-9.99.63-amd64/usr/lib/../lib/i386/crti.o' is 
incompatible with i386 output
—
optimization was done using cpuflags:
ARCH: -march=native
FEATURES: -mfpmath=sse -msse3
CPUFLAGS: -mfpmath=sse -msse3 -march=native
GCC version : 8.4.0
OS  : 'NetBSD'
OS version  : '9.99.63'
hw.model: 'Intel 686-class'
hw.machine  : 'amd64'
hw.machine_arch : 'x86_64'
CPU : ''
cpu_name="highest basic info 000d"
cpu_brand="IntelR XeonR CPU E5-2640 0 @ 2.50GHz“

Any ideas?

cheers
Oskar



smime.p7s
Description: S/MIME cryptographic signature