Summary: | lang/scm fails to build with GCC 8 | ||||||
---|---|---|---|---|---|---|---|
Product: | Ports & Packages | Reporter: | Gerald Pfeifer <gerald> | ||||
Component: | Individual Port(s) | Assignee: | Mikhail Teterin <mi> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Some People | CC: | freebsd-2024, w.schwarzenfeld | ||||
Priority: | --- | Flags: | bugzilla:
maintainer-feedback?
(freebsd-2024) |
||||
Version: | Latest | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
Attachments: |
|
Description
Gerald Pfeifer
2018-11-03 14:47:54 UTC
In scm/build.scm: line 1634: "gcc49" "-O2 -pipe -Wall -Wwrite-strings -Wmissing-declarations -Wredundant-decls -Wcast-qual -Wno -unused-label -Wno-uninitialized -fstack-protector -Wl,-rpath=/usr/local/lib/gcc49 -fno-strict-aliasing " "-c" and line 1655: parms "gcc49" "-O2 -pipe -Wall -Wwrite-strings -Wmissing-declarations -Wredundant-decls -Wcast-qua l -Wno-unused-label -Wno-uninitialized -fstack-protector -Wl,-rpath=/usr/local/lib/gcc49 -fno-strict-aliasing " "-fPI C" "-c" rpath is set to gcc49. I am always too fast. gcc49 is on my box cause of GCC=any. If I change it, it builds fine. Created attachment 199040 [details]
scm.diff
The port builds fine with GCC 8 when compiled WITH_DEBUG. Removing
-O2 from CFLAGS seems to work as well.
(In reply to Tobias Kortkamp from comment #3) > Created attachment 199040 [details] > > The port builds fine with GCC 8 when compiled WITH_DEBUG. Removing > -O2 from CFLAGS seems to work as well. Thanks for the digging into this and the patch, Tobias! Would it be sufficient to change to -O1 instead of disabling optimizations? Mikhail, your take as maintainer? (In reply to Gerald Pfeifer from comment #4) > Would it be sufficient to change to -O1 instead of disabling > optimizations? No, that doesn't work. I guess we can land this with maintainer timeout after tomorrow. Unless someone has a better idea? Should the CFLAGS hack be made conditional on the GCC version? Not exactly sure how to add such a check though given that the port uses USE_GCC=any vs USE_GCC=yes. (In reply to Tobias Kortkamp from comment #5) s/tomorrow/Wednesday/ (In reply to Tobias Kortkamp from comment #5) > I guess we can land this with maintainer timeout [Wednesday] Yes, please. This is the last PR blocking the update to GCC 8 as the default. > Should the CFLAGS hack be made conditional on the GCC version? > Not exactly sure how to add such a check though given that the port > uses USE_GCC=any vs USE_GCC=yes. USE_GCC=any really only should make a difference on non-tier 1 architectures that still have the age old GCC 4.2 as a system compiler. Everywhere else it is the same as USE_GCC=yes. Hence I would not start hacking around re CFLAGS, and in fact switch over to USE_GCC=yes: Doesn't make a difference for nearly everyone and actually gets those lower tier architectures more on par using what those that are regularly tested/used, increasing the chance it'll actually build and work there, too. Thanks for your help with this, Tobias! A commit references this bug: Author: mi Date: Sun Nov 18 22:06:46 UTC 2018 New revision: 485281 URL: https://svnweb.freebsd.org/changeset/ports/485281 Log: Try to improve chances of successful build - including, but not limited to disabling compiler-optimizations. Proper fixing seems inherently impossible -- even with -O0 valgrind flags hundreds of unitilized memory accesses during self-check. Tested with gcc8 and the base cc (clang) -- remove the GCC-requirement. Add some patches from Debian. While here simplify the extract-target a little and remove the BROKEN* lines to attempt building on other platforms again... Bump port-revision. PR: 232936 Changes: head/lang/scm/Makefile head/lang/scm/files/patch-bigrecy_32bit_upstream head/lang/scm/files/patch-scmfig.h head/lang/scm/files/patch-texinfo5_fixes head/lang/scm/files/patch-warnings (In reply to commit-hook from comment #8) It doesn't stage now: install: /wrkdirs/usr/ports/lang/scm/work/scm/edline.so: No such file or directory earlier there is: edline.c:22:10: fatal error: 'readline/readline.h' file not found #include <readline/readline.h> ^~~~~~~~~~~~~~~~~~~~~ 1 error generated. http://beefy11.nyi.freebsd.org/data/head-i386-default/p485373_s340656/logs/errors/scm-5f2_9.log I can't reproduce this here -- my machine has readline installed by the base. How about this patch: Index: Makefile =================================================================== --- Makefile (revision 486395) +++ Makefile (working copy) @@ -25,6 +25,7 @@ CFLAGS:= ${CFLAGS:N-O*} -O0 CFLAGS+= -Wall -Wwrite-strings -Wmissing-declarations -Wredundant-decls -Wcast-qual CFLAGS+= -Wno-unused-label -Wno-uninitialized +CFLAGS+= ${readline_ARGS:S|^port$|${CPPFLAGS}|:S|^$|-I/usr/include/edit|} SUB_FILES= require.scm ? Thank you! (In reply to Mikhail Teterin from comment #10) No, that doesn't fix the problem, but the error changes: (system "cc -shared -lreadline -o edline.so edline.o") /usr/bin/ld: error: unable to find library -lreadline cc: error: linker command failed with exit code 1 (use -v to see invocation) Looks like an additional edit of build.scm to add -L${LOCALBASE}/lib could help here. A commit references this bug: Author: mi Date: Wed Dec 19 19:53:17 UTC 2018 New revision: 487812 URL: https://svnweb.freebsd.org/changeset/ports/487812 Log: Unbreak by providing handling for readline from base as well as from port. PR: 232936 Changes: head/lang/scm/Makefile |