Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 201786 - app-accessibility/flite-1.2-r1 fails with --as-needed in LDFLAGS
Summary: app-accessibility/flite-1.2-r1 fails with --as-needed in LDFLAGS
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Accessibility Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: as-needed
  Show dependency tree
 
Reported: 2007-12-09 18:22 UTC by Bernd Steinhauser
Modified: 2008-03-06 14:37 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Workaround, that filters the flag (flite-1.2-r1.ebuild.patch,720 bytes, patch)
2007-12-09 18:24 UTC, Bernd Steinhauser
Details | Diff
Patch for 2 Makefiles that may fix the --as-needed bug (file_patch.diff,3.14 KB, patch)
2008-01-22 12:02 UTC, Kent Fredric (IRC: kent\n) (RETIRED)
Details | Diff
compile errors for flite 1.3 (flite_error,1.38 KB, text/plain)
2008-01-25 16:24 UTC, egon2003
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bernd Steinhauser 2007-12-09 18:22:12 UTC
app-accessability/flite will fail when --as-needed is defined in LDFLAGS, removing it works:

gcc -march=k8 -O2 -pipe -msse3 -Wall    -o regexcomp regexcomp_main.o  -Wl,-O1 -Wl,--as-needed -L./lib -lflite -lm   -L../lib -lflite -lm
../lib/libflite.so: undefined reference to `sqrt'
../lib/libflite.so: undefined reference to `fmod'
../lib/libflite.so: undefined reference to `exp'
../lib/libflite.so: undefined reference to `sin'
../lib/libflite.so: undefined reference to `cos'
collect2: ld returned 1 exit status
make[1]: *** [regexcomp] Error 1
make: *** [.make_build_dirs] Error 2
 *
 * ERROR: app-accessibility/flite-1.2-r1 failed.
 * Call stack:
 *             ebuild.sh, line 1701:  Called dyn_compile
 *             ebuild.sh, line 1039:  Called qa_call 'src_compile'
 *             ebuild.sh, line   44:  Called src_compile
 *   flite-1.2-r1.ebuild, line   41:  Called die
 * The specific snippet of code:
 *      emake -j1 || die "Failed compilation"
 *  The die message:
 *   Failed compilation

Reproducible: Always
Comment 1 Bernd Steinhauser 2007-12-09 18:24:09 UTC
Created attachment 138112 [details, diff]
Workaround, that filters the flag

This makes it compile.
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2007-12-09 19:16:40 UTC
Comment on attachment 138112 [details, diff]
Workaround, that filters the flag

That's just wrong solution... :)
Comment 3 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2008-01-22 12:02:28 UTC
Created attachment 141574 [details, diff]
Patch for 2 Makefiles that may fix the --as-needed bug

Managed to hack a few MAKEFILES and get this to work for me. Would make an ebuild, but seeing i've done the hard work now to get it going (albeit a bit nasty i think) you've got the easy job :)

I added a few more lines of output verbosity for debugging purposes, feel free to remove them. ( this library does some magic which i deem to be weird (ie: unpack an AR file to a dir and then recompile as a lib seems unusual to me, but im no makefile guru or anything, i was simply _LUCKY_ enough to fix this myself )
Comment 4 William Hubbs gentoo-dev 2008-01-24 05:42:21 UTC
I just found patches that made it possible to commit flite 1.3 to the tree.  Can you please check the new version and see if this issue is still present?

Thanks much.

William
Comment 5 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2008-01-25 12:44:17 UTC
(In reply to comment #4)
> I just found patches that made it possible to commit flite 1.3 to the tree. 
> Can you please check the new version and see if this issue is still present?
> 
> Thanks much.
> 
> William
>
 
I can't even confirm if the --as-needed problem exists any more because of a new bug that will have to get fixed before I'll be able to know. 

386-linux-gnu/obj/lang/cmu_us_kal16/cmu_us_kal16_res.os
i686-pc-linux-gnu-gcc -fPIC   -I../../lang/usenglish  -I../../lang/cmulex -I../../include -O2 -march=native -pipe  -Wall    -c cmu_us_kal16_residx.c -o ../../build/i386-linux-gnu/obj/lang/cmu_us_kal16/cmu_us_kal16_residx.os
a - cmu_us_kal16_diphone.os
a - cmu_us_kal16.os
a - cmu_us_kal16_lpc.os
a - cmu_us_kal16_res.os
a - cmu_us_kal16_residx.os
making in lib ...
making libflite.so
making libflite_cmulex.so
/bin/sh: line 0: cd: shared_os: No such file or directory
make[1]: *** [libflite.so] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [build/i386-linux-gnu/obj//.make_build_dirs] Error 2
 *

Having run through this code enough to know what "shared_os" is, im going "huh?, somethings bust"

cos its doing this:


# Used in the lib/ directory and in building new voices
%.so: %.shared.a
        @ echo making $@
        @ rm -rf shared_os && mkdir shared_os
        @ rm -f $@ $@.${PROJECT_VERSION} $@.${PROJECT_SHLIB_VERSION}
        @ (cd shared_os && ar x ../$<)
        @ (cd shared_os && $(CC) -shared -Wl,-soname,$@.${PROJECT_SHLIB_VERSION} -o ../$@.${PROJECT_VERSION} *.os -L../ $($(@:%.so=%_LDLIBS)))
        @ ln -s $@.${PROJECT_VERSION} $@.${PROJECT_SHLIB_VERSION}
        @ ln -s $@.${PROJECT_SHLIB_VERSION} $@
        @ rm -rf shared_os

strangely, when i cd into the directory, source app-accesbility/flite/temp/environment,  and then hit make, seems to run fine. 

(( weird ))
Comment 6 egon2003 2008-01-25 16:24:25 UTC
Created attachment 141774 [details]
compile errors for flite 1.3

I get this error while trying to emerge flite 1.3
Comment 7 Dirk Heinrichs 2008-01-26 18:48:27 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > I just found patches that made it possible to commit flite 1.3 to the tree. 
> > Can you please check the new version and see if this issue is still present?
> > 
> > Thanks much.
> > 
> > William
> >
> 
> I can't even confirm if the --as-needed problem exists any more because of a
> new bug that will have to get fixed before I'll be able to know. 
> 
> 386-linux-gnu/obj/lang/cmu_us_kal16/cmu_us_kal16_res.os
> i686-pc-linux-gnu-gcc -fPIC   -I../../lang/usenglish  -I../../lang/cmulex
> -I../../include -O2 -march=native -pipe  -Wall    -c cmu_us_kal16_residx.c -o
> ../../build/i386-linux-gnu/obj/lang/cmu_us_kal16/cmu_us_kal16_residx.os
> a - cmu_us_kal16_diphone.os
> a - cmu_us_kal16.os
> a - cmu_us_kal16_lpc.os
> a - cmu_us_kal16_res.os
> a - cmu_us_kal16_residx.os
> making in lib ...
> making libflite.so
> making libflite_cmulex.so
> /bin/sh: line 0: cd: shared_os: No such file or directory
> make[1]: *** [libflite.so] Error 1
> make[1]: *** Waiting for unfinished jobs....
> make: *** [build/i386-linux-gnu/obj//.make_build_dirs] Error 2
>  *

This is solved by setting MAKEOPTS to "-j1". Seems flite 1.3 is not parallel build save.
Comment 8 William Hubbs gentoo-dev 2008-01-26 20:37:23 UTC
I have changed the "emake" to "emake -j1" in the ebuild so that it will run only one job.  Please check again and let me know if the issue with --as-needed still exists.


Thanks much.


Comment 9 Bernd Steinhauser 2008-01-26 21:14:16 UTC
Nope, problem solved.

But honestly, -j1 is just as bad as filtering --as-needed.
Judging by all the warnings the build spits out this is really some wicked software. ;)
Comment 10 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2008-01-26 23:23:19 UTC
(In reply to comment #9)
> Nope, problem solved.
> 


Looks solved for me too with -j1. Its peculiar, becuase the place its bugging in with parallel build hasn't changed since 1.2 as far as I can tell, unless of course its running 2 instances of the 'library unpack and compile' phase in parallel for some reason where it wasn't before. 

You could of course re-mangle the make file so that instead of creating shared_os for every unpack, you could do shared_os_$(SOMEJOBSUFFIX) 

> But honestly, -j1 is just as bad as filtering --as-needed.

But admittedly, forcing a single threaded build instead of multi-threaded is hardly something to complain about, unlike --as-needed which changes resultant output and runtime significantly ;)
Comment 11 William Hubbs gentoo-dev 2008-03-06 14:37:31 UTC
I am closing this bug since it is fixed.

Thanks much for the report.