Re: GCC changes break "libscrypt" package in F36

2022-02-10 Thread Florian Weimer
* Denis Fateyev:

> Thank you, all variants work fine.
>
> Now I have another issue with "nfdump" package, probably for the same
> reason: a build flag interference.
>
> I use '-fPIC' in LDFLAGS to make "configure" happy:
> https://src.fedoraproject.org/rpms/nfdump/blob/rawhide/f/nfdump.spec#_49

-fPIC (or rather, -fPIE) must be in CFLAGS.  But the Fedora build flags
should be handling this correctly, via
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1.

The issue seems to be in the upstream makefiles.  Compilation completely
ignores CFLAGS:

gcc -DHAVE_CONFIG_H -I. -I..-DPCAP -g -O3 -std=gnu11 -Wall 
-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations 
-Wmissing-noreturn -fno-strict-aliasing -DNSEL -c -o nfcapd-nfcapd.o `test -f 
'nfcapd.c' || echo './'`nfcapd.c

It is actually overriden by configure:

# Checks for programs.
CFLAGS="-g -O3"
AC_PROG_CC([clang gcc])
AX_CHECK_C11
CFLAGS="$CFLAGS -Wall -Wstrict-prototypes -Wmissing-prototypes 
-Wmissing-declarations -Wmissing-noreturn -fno-strict-aliasing"

I suggest to delete that CFLAGS="-g -O3" line.

Thanks,
Florian
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


Re: GCC changes break "libscrypt" package in F36

2022-02-09 Thread Denis Fateyev
Thank you, all variants work fine.

Now I have another issue with "nfdump" package, probably for the same
reason: a build flag interference.

I use '-fPIC' in LDFLAGS to make "configure" happy:
https://src.fedoraproject.org/rpms/nfdump/blob/rawhide/f/nfdump.spec#_49

I suspect that this flag presence affects the package build, or maybe it's
related to other changes.
It worked for F35 and earlier, and still works with simple "./configure &&
make" (without RPM build flags).

...
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -ggdb -g -O3 -std=gnu11
-Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
-Wmissing-noreturn -fno-strict-aliasing -DNSEL -c ipconv.c  -fPIC -DPIC -o
.libs/ipconv.o
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..
   -ggdb  -g -O3 -std=gnu11 -Wall -Wstrict-prototypes -Wmissing-prototypes
-Wmissing-declarations -Wmissing-noreturn -fno-strict-aliasing -DNSEL -c -o
exporter.lo exporter.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -ggdb -g -O3 -std=gnu11
-Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
-Wmissing-noreturn -fno-strict-aliasing -DNSEL -c exporter.c  -fPIC -DPIC
-o .libs/exporter.o
/bin/sh ../libtool  --tag=CC   --mode=link gcc -ggdb  -g -O3 -std=gnu11
-Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
-Wmissing-noreturn -fno-strict-aliasing -DNSEL -release 1.6.23 -Wl,-z,relro
-Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1
-Wl,-dT,/home/mock/rpmbuild/BUILD/nfdump-1.6.23/.package_note-nfdump-1.6.23-3.fc36.x86_64.ld
-fPIC -o libnfdump.la -rpath /usr/lib64 output_util.lo output_raw.lo
output_json.lo output_csv.lo output_pipe.lo output_fmt.lo util.lo
minilzo.lo lz4.lo nffile.lo nfx.lo flist.lo fts_compat.lo grammar.lo
scanner.lo nftree.lo ipconv.lo exporter.lo  -lresolv -lbz2
libtool: link: gcc -shared  -fPIC -DPIC  .libs/output_util.o
.libs/output_raw.o .libs/output_json.o .libs/output_csv.o
.libs/output_pipe.o .libs/output_fmt.o .libs/util.o .libs/minilzo.o
.libs/lz4.o .libs/nffile.o .libs/nfx.o .libs/flist.o .libs/fts_compat.o
.libs/grammar.o .libs/scanner.o .libs/nftree.o .libs/ipconv.o
.libs/exporter.o   -lresolv -lbz2 -Wl,-z,now
-specs=/usr/lib/rpm/redhat/redhat-hardened-ld -ggdb -g -O3 -Wl,-z -Wl,relro
-Wl,--as-needed -Wl,-z -Wl,now
-specs=/usr/lib/rpm/redhat/redhat-hardened-ld
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -Wl,-dT
-Wl,/home/mock/rpmbuild/BUILD/nfdump-1.6.23/.package_note-nfdump-1.6.23-3.fc36.x86_64.ld
  -Wl,-soname -Wl,libnfdump-1.6.23.so -o .libs/libnfdump-1.6.23.so
libtool: link: (cd ".libs" && rm -f "libnfdump.so" && ln -s "
libnfdump-1.6.23.so" "libnfdump.so")
libtool: link: ( cd ".libs" && rm -f "libnfdump.la" && ln -s "../
libnfdump.la" "libnfdump.la" )
/bin/sh ../libtool  --tag=CC   --mode=link gcc -DPCAP -g -O3 -std=gnu11
-Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
-Wmissing-noreturn -fno-strict-aliasing -DNSEL  -Wl,-z,relro
-Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1
-Wl,-dT,/home/mock/rpmbuild/BUILD/nfdump-1.6.23/.package_note-nfdump-1.6.23-3.fc36.x86_64.ld
-fPIC -o nfcapd nfcapd-nfcapd.o nfcapd-nfstatfile.o nfcapd-launch.o
nfcapd-nfnet.o nfcapd-collector.o nfcapd-netflow_v1.o
nfcapd-netflow_v5_v7.o nfcapd-netflow_v9.o nfcapd-ipfix.o
nfcapd-bookkeeper.o nfcapd-expire.o nfcapd-pcap_reader.o libnfdump.la
-lpcap  -lresolv -lbz2
libtool: link: gcc -DPCAP -g -O3 -std=gnu11 -Wall -Wstrict-prototypes
-Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn
-fno-strict-aliasing -DNSEL -Wl,-z -Wl,relro -Wl,--as-needed -Wl,-z -Wl,now
-specs=/usr/lib/rpm/redhat/redhat-hardened-ld
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -Wl,-dT
-Wl,/home/mock/rpmbuild/BUILD/nfdump-1.6.23/.package_note-nfdump-1.6.23-3.fc36.x86_64.ld
-fPIC -o .libs/nfcapd nfcapd-nfcapd.o nfcapd-nfstatfile.o nfcapd-launch.o
nfcapd-nfnet.o nfcapd-collector.o nfcapd-netflow_v1.o
nfcapd-netflow_v5_v7.o nfcapd-netflow_v9.o nfcapd-ipfix.o
nfcapd-bookkeeper.o nfcapd-expire.o nfcapd-pcap_reader.o
 ./.libs/libnfdump.so -lpcap -lresolv -lbz2
/usr/bin/ld: nfcapd-nfcapd.o: relocation R_X86_64_32 against
`.rodata.str1.8' can not be used when making a PIE object; recompile with
-fPIE
/usr/bin/ld: nfcapd-nfstatfile.o: relocation R_X86_64_32 against
`.rodata.str1.1' can not be used when making a PIE object; recompile with
-fPIE
/usr/bin/ld: nfcapd-launch.o: relocation R_X86_64_32S against `.rodata' can
not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: nfcapd-nfnet.o: relocation R_X86_64_32 against
`.rodata.str1.8' can not be used when making a PIE object; recompile with
-fPIE
/usr/bin/ld: nfcapd-collector.o: relocation R_X86_64_32 against
`.rodata.str1.1' can not be used when making a PIE object; recompile with
-fPIE
/usr/bin/ld: nfcapd-

Re: GCC changes break "libscrypt" package in F36

2022-02-09 Thread Vitaly Zaitsev via devel

On 08/02/2022 21:41, Florian Weimer wrote:

CFLAGS?=-O2 -Wall -g -D_FORTIFY_SOURCE=2 -fstack-protector -fPIC
LDFLAGS?=-Wl,-z,now -Wl,-z,relro -Wl,-soname,libscrypt.so.0 
-Wl,--version-script=libscrypt.version


Can be easily fixed by changing ?= with +=.

--
Sincerely,
  Vitaly Zaitsev (vit...@easycoding.org)
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


Re: GCC changes break "libscrypt" package in F36

2022-02-08 Thread Florian Weimer
* Denis Fateyev:

> For example,  "libscrypt" package issue is filled here:
> https://bugzilla.redhat.com/show_bug.cgi?id=2046062
> The library in the package was actually built, but the build results are 
> different under
> various GCC versions — as shown in the "nm" dump below.
>
> Has anybody already faced a similar issue? Is there any information on
> what could cause the problem, and how to fix it?

The upstream makefile uses:

CFLAGS?=-O2 -Wall -g -D_FORTIFY_SOURCE=2 -fstack-protector -fPIC
LDFLAGS?=-Wl,-z,now -Wl,-z,relro -Wl,-soname,libscrypt.so.0 
-Wl,--version-script=libscrypt.version

Due to this change

  %set_build_flags for %build, %check, and %install phases
  

CLFAGS and LDFLAGS are now set by Fedora, effectively dropping the
package-specific -Wl,-z,relro -Wl,-soname,libscrypt.so.0
-Wl,--version-script=libscrypt.version flags.

If you add

LDFLAGS="$LDFLAGS -Wl,-z,relro -Wl,-soname,libscrypt.so.0 
-Wl,--version-script=libscrypt.version"

to %build before the make invocation, it should get things to work as
before.  Or perhaps patch the upstream makefile, so that you get a patch
application failure if the upstream flag defaults change:

-LDFLAGS?=-Wl,-z,now -Wl,-z,relro -Wl,-soname,libscrypt.so.0 
-Wl,--version-script=libscrypt.version
+LDFLAGS += -Wl,-soname,libscrypt.so.0 -Wl,--version-script=libscrypt.version

Thanks,
Florian
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


GCC changes break "libscrypt" package in F36

2022-02-08 Thread Denis Fateyev
Hello all,

Recently, I have found that with GCC version bump in F36 some of my
packages are stopped to build, or stopped to build properly during the
planned package rebuild.
They were fine under F35 — but apparently there are some changes in newer
GCC that affected them.

For example,  "libscrypt" package issue is filled here:
https://bugzilla.redhat.com/show_bug.cgi?id=2046062
The library in the package was actually built, but the build results are
different under various GCC versions — as shown in the "nm" dump below.

Has anybody already faced a similar issue? Is there any information on what
could cause the problem, and how to fix it?

Thanks!

[Fedora35]$ nm -D libscrypt.so.0
 U close@GLIBC_2.2.5
 U __ctype_b_loc@GLIBC_2.3
 w __cxa_finalize@GLIBC_2.2.5
 U __errno_location@GLIBC_2.2.5
 U free@GLIBC_2.2.5
 w __gmon_start__
 w _ITM_deregisterTMCloneTable
 w _ITM_registerTMCloneTable
 A libscrypt
4520 T libscrypt_check@@libscrypt
46f0 T libscrypt_hash@@libscrypt
3d80 T libscrypt_mcf@@libscrypt
4430 T libscrypt_salt_gen@@libscrypt
1600 T libscrypt_scrypt@@libscrypt
 U malloc@GLIBC_2.2.5
 U memcpy@GLIBC_2.14
 U mmap@GLIBC_2.2.5
 U munmap@GLIBC_2.2.5
 U open@GLIBC_2.2.5
 U read@GLIBC_2.2.5
 U __snprintf_chk@GLIBC_2.3.4
 U __stack_chk_fail@GLIBC_2.4
 U strchr@GLIBC_2.2.5
 U strlen@GLIBC_2.2.5
 U strtok_r@GLIBC_2.2.5
 U strtoul@GLIBC_2.2.5

[Fedora36]$ nm -D libscrypt.so.0
 U close@GLIBC_2.2.5
 U __ctype_b_loc@GLIBC_2.3
 w __cxa_finalize@GLIBC_2.2.5
 U __errno_location@GLIBC_2.2.5
 U free@GLIBC_2.2.5
 w __gmon_start__
 w _ITM_deregisterTMCloneTable
 w _ITM_registerTMCloneTable
43e0 T libscrypt_b64_decode
4240 T libscrypt_b64_encode
4950 T libscrypt_check
47c0 T libscrypt_hash
3880 T libscrypt_HMAC_SHA256_Final
3620 T libscrypt_HMAC_SHA256_Init
3870 T libscrypt_HMAC_SHA256_Update
4170 T libscrypt_mcf
38f0 T libscrypt_PBKDF2_SHA256
4690 T libscrypt_salt_gen
3c90 T libscrypt_scrypt
34d0 T libscrypt_SHA256_Final
3290 T libscrypt_SHA256_Init
32c0 T libscrypt_SHA256_Update
 U malloc@GLIBC_2.2.5
 U memcpy@GLIBC_2.14
 U mmap@GLIBC_2.2.5
 U munmap@GLIBC_2.2.5
 U open@GLIBC_2.2.5
 U read@GLIBC_2.2.5
48f0 T slow_equals
 U __snprintf_chk@GLIBC_2.3.4
 U __stack_chk_fail@GLIBC_2.4
 U strchr@GLIBC_2.2.5
 U strlen@GLIBC_2.2.5
 U strtok_r@GLIBC_2.2.5
 U strtoul@GLIBC_2.2.5


-- 
wbr, Denis.
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure