Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 427346

Summary: =dev-scheme/guile-1.8.8-r1 fails to build with clang-3.1-r4
Product: Gentoo Linux Reporter: Fabio Scaccabarozzi <fsvm88>
Component: Current packagesAssignee: Scheme Project <scheme>
Status: CONFIRMED ---    
Severity: normal CC: amit.ugol, hasufell, mgorny, ryao, srcshelton
Priority: Normal Keywords: NeedPatch
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 408963    
Attachments: emerge fail log

Description Fabio Scaccabarozzi 2012-07-20 15:53:11 UTC
Created attachment 318746 [details]
emerge fail log

=dev-scheme/guile-1.8.8-r1 fails to build with clang-3.1-r4
Comment 1 Austin English (RETIRED) gentoo-dev 2014-02-25 21:12:22 UTC
With clang-3.3 and guile-1.8.8-r1:
./guile_filter_doc_snarfage --filter-snarfage) > regex-posix.doc || { rm regex-posix.doc; false; }
cat alist.doc arbiters.doc async.doc backtrace.doc boolean.doc chars.doc continuations.doc debug.doc deprecation.doc deprecated.doc discouraged.doc dynl.doc dynwind.doc environments.doc eq.doc error.doc eval.doc evalext.doc extensions.doc feature.doc fluids.doc fports.doc futures.doc gc.doc goops.doc gsubr.doc gc-mark.doc gc-segment.doc gc-malloc.doc gc-card.doc guardians.doc hash.doc hashtab.doc hooks.doc i18n.doc init.doc ioext.doc keywords.doc lang.doc list.doc load.doc macros.doc mallocs.doc modules.doc numbers.doc objects.doc objprop.doc options.doc pairs.doc ports.doc print.doc procprop.doc procs.doc properties.doc random.doc rdelim.doc read.doc root.doc rw.doc scmsigs.doc script.doc simpos.doc smob.doc sort.doc srcprop.doc stackchk.doc stacks.doc stime.doc strings.doc srfi-4.doc srfi-13.doc srfi-14.doc strorder.doc strports.doc struct.doc symbols.doc threads.doc throw.doc values.doc variable.doc vectors.doc version.doc vports.doc weaks.doc ramap.doc unif.doc dynl.doc filesys.doc posix.doc net_db.doc socket.doc regex-posix.doc | GUILE="/var/tmp/portage/dev-scheme/guile-1.8.8-r1/work/guile-1.8.8/pre-inst-guile" ../scripts/snarf-check-and-output-texi          > guile-procedures.texi || { rm guile-procedures.texi; false; }
ERROR: In procedure apply:
ERROR: Wrong type argument in position 1: #<freed cell 0x7f3087aecd70; GC missed a reference>
Makefile:2549: recipe for target 'guile-procedures.texi' failed
make[3]: *** [guile-procedures.texi] Error 1
Comment 2 Julian Ospald 2015-02-22 21:29:17 UTC
there are some freebsd patches here http://svnweb.freebsd.org/ports/head/lang/guile/files/ but I cannot figure out which one is a fix (if any)
Comment 3 Jeff Sweeney 2015-08-29 21:03:46 UTC
From the FreeBSD patches (#2):

This is a three-part for building guile with clang (or with any other
modern compiler):

1) Use -fwrap in CFLAGS, since guile depends on integer overflows.
2) Fix grep + sed logic in guile-snarf.in to be compatible with the output
   of clang's preprocessor.  This is achieved by adding additional newlines
   before the ^^ delimiters, which guile-snarf depends on.
3) Similarly, in c-tokenize.c, clang's preprocessor outputs EOLs and hash
   marks in different places, confusing the lexer.  Simply don't output
   them to fix the problem.

While here strip binaries and libraries.

Submitted by:	dim@

- Looks like the changes needed are from this revision [http://svnweb.freebsd.org/ports?view=revision&sortby=rev&revision=352517] - includes two patch files, and a change to the Makefile to include -fwrapv into the CFLAGS.
Comment 4 Austin English (RETIRED) gentoo-dev 2016-06-28 03:16:01 UTC
FWIW, 2.0.0 was fixed for clang by https://github.com/gentoo/gentoo/commit/d3bce60414f651b5044d8276ad9c3e3f5afe9e15

1.8.8 is still broken though. Really, it should be deprecated, that's bug 587252.
Comment 5 Amy Liffey gentoo-dev 2016-06-28 09:22:25 UTC
(In reply to Austin English from comment #4)
> FWIW, 2.0.0 was fixed for clang by
> https://github.com/gentoo/gentoo/commit/
> d3bce60414f651b5044d8276ad9c3e3f5afe9e15
> 
> 1.8.8 is still broken though. Really, it should be deprecated, that's bug
> 587252.

However problem is that guile-2.0.0 is still broken.
Comment 6 Amit Ugol 2024-04-02 19:41:19 UTC
dev-scheme/guile-2.2.7-r1 compiles correctly with:

env file:
CFLAGS="${CFLAGS} -flto=thin"
CXXFLAGS="${CXXFLAGS} -flto=thin"
# -O2 in LDFLAGS refers to binary size optimization during linking, it is NOT related to the -O levels of the compiler              
LDFLAGS="${LDFLAGS} -Wl,-O2 -Wl,--as-needed"

CC="clang"
CXX="clang++"
AR="llvm-ar"
NM="llvm-nm"
RANLIB="llvm-ranlib"


clang version 18.1.2

Besides, this is old. I am sure that whatever reason why this did not work 12 years ago is irrelevant at this point. I suggest closing this one and if users have the same symptom, open a new bug.