Bug 239712 - graphics/blender: Build fails during compilation - Undefined references in libflite_cmu_us_kal.so.1 and libflite_cmu_us_awb.so.1
Summary: graphics/blender: Build fails during compilation - Undefined references in li...
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-ports-bugs mailing list
URL:
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2019-08-08 10:25 UTC by Ross McKelvie
Modified: 2019-08-24 09:01 UTC (History)
2 users (show)

See Also:
FreeBSD: maintainer-feedback+


Attachments
poudriere testport log for blender-2.79b_14 (gzipped) (153.35 KB, application/gzip)
2019-08-08 10:25 UTC, Ross McKelvie
no flags Details
poudriere testport log for patched Makefile (170.17 KB, application/gzip)
2019-08-08 11:22 UTC, Ross McKelvie
no flags Details
Proposed Makefile patch (275 bytes, patch)
2019-08-08 11:23 UTC, Ross McKelvie
no flags Details | Diff
Proposed Makefile patch v2 (399 bytes, patch)
2019-08-08 13:08 UTC, Ross McKelvie
no flags Details | Diff
poudriere testport log for patched Makefile v2 (168.48 KB, application/gzip)
2019-08-08 13:09 UTC, Ross McKelvie
no flags Details
poudriere testport log for blender-2.80 (gzipped) (189.26 KB, application/gzip)
2019-08-15 21:00 UTC, Ross McKelvie
no flags Details
Proposed patch (Subversion diff for blender-2.80_1) (735 bytes, patch)
2019-08-15 21:05 UTC, Ross McKelvie
FreeBSD: maintainer-approval+
Details | Diff
poudriere testport log for proposed blender-2.80_1 (gzipped) (206.08 KB, application/gzip)
2019-08-15 21:06 UTC, Ross McKelvie
no flags Details
portlint -C output for proposed patch blender-2.80_1 (274 bytes, text/plain)
2019-08-15 21:08 UTC, Ross McKelvie
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ross McKelvie 2019-08-08 10:25:47 UTC
Created attachment 206360 [details]
poudriere testport log for blender-2.79b_14 (gzipped)

The build of graphics/blender fails during compilation on amd64 11.3-RELEASE-p2.

Reported errors:
/usr/local/lib/libflite_cmu_us_kal.so.1: undefined reference to `cmu_postlex'
/usr/local/lib/libflite_cmu_us_awb.so.1: undefined reference to `usenglish_init'
/usr/local/lib/libflite_cmu_us_awb.so.1: undefined reference to `cmu_lex_init'
c++: error: linker command failed with exit code 1

I have attached the poudriere testport log with ccache disabled.  You will see I use non-default options, though also experience the same build error with default graphics/blender options.

Version 2.79b_13 previously built successfully.  Many thanks in advance for investigating.
Comment 1 Walter Schwarzenfeld freebsd_triage 2019-08-08 10:42:47 UTC
A similar error happens here with ffmpeg bug #239567. Fixed on 1. August 2019.
Comment 2 Ross McKelvie 2019-08-08 11:22:54 UTC
Created attachment 206362 [details]
poudriere testport log for patched Makefile
Comment 3 Ross McKelvie 2019-08-08 11:23:37 UTC
Created attachment 206363 [details]
Proposed Makefile patch
Comment 4 Ross McKelvie 2019-08-08 11:25:55 UTC
Many thanks for spotting that, Walter.

I have attached a proposed patch for the Makefile (to set LDFLAGS= -fuse-ld=lld) and the poudriere testport log showing the build completing successfully.
Comment 5 Ross McKelvie 2019-08-08 13:08:59 UTC
Created attachment 206368 [details]
Proposed Makefile patch v2

Having done some reading (also pointed out in bug #239567, comment #5) around the transition to the LLVM linker and discovering that:
(a) It may already be the default linker (see WITH_LLD_IS_LD in src.conf(5)) and (b) The LLVM linker is not available on all architectures,

I propose to wrap the LDFLAGS in an if statement as per the workaround suggested in bug #239567, comment #6.  Note this doesn't guarantee that linking will work correctly but does at least mean that architectures without the LLVM linker will not definitely be broken.

Updated proposed patch and poudriere testport log attached.
Comment 6 Ross McKelvie 2019-08-08 13:09:56 UTC
Created attachment 206369 [details]
poudriere testport log for patched Makefile v2
Comment 7 Shane 2019-08-09 05:16:31 UTC
If this is needed, it should be added to bug #239589 where this port is being updated to 2.80

Does the 2.80 version make a difference?
Comment 8 Ross McKelvie 2019-08-09 15:55:27 UTC
(In reply to Shane from comment #7)
Shane, thanks for your reply.  Unfortunately I've not been able to successfully apply your patch from bug 239589.  Having first tried to apply the patch to the latest revision of the ports tree I saw the patch is for port revision 13, not 14.  I then attempted to apply it to revision 508215 of the ports tree (that is, the commit just prior to the one for graphics/blender revision 14).

The patch check succeeds for all files except the Makefile.  Have I made an error in my approach (below)?

% svnlite checkout https://svn.FreeBSD.org/ports/head@508215 ./blendertesting
% cd blendertesting
% patch -Cu < ~/blender28.patch                                                                                   
Hmm...  Looks like a unified diff to me...                                                     
The text leading up to this was:                                                               
--------------------------      
|diff -Nru graphics/blender.orig/Makefile graphics/blender/Makefile                                                                                                                           
|--- graphics/blender.orig/Makefile     2019-08-02 13:52:14.343159000 +0930                                                                                                                   
|+++ graphics/blender/Makefile  2019-08-02 13:51:38.830466000 +0930                                                                                                                           
--------------------------                                                                     
Patching file Makefile using Plan A...                                                                                                                                                        
Hunk #1 failed at 2.                                                                           
Hunk #2 failed at 24.                                                                          
Hunk #3 failed at 74.           
Hunk #4 failed at 92.                                                                          
Hunk #5 failed at 125.                                                                         
Hunk #6 failed at 161.                                                                         
6 out of 6 hunks failed while patching Makefile
Comment 9 Ross McKelvie 2019-08-15 21:00:47 UTC
Created attachment 206596 [details]
poudriere testport log for blender-2.80 (gzipped)

The reported bug still exists for the new version of the port committed in bug #239589.  I have attached the poudriere testport log.
Comment 10 Ross McKelvie 2019-08-15 21:05:12 UTC
Created attachment 206597 [details]
Proposed patch (Subversion diff for blender-2.80_1)

I propose the attached patch to modify LDFLAGS to use the LLVM linker where it is available.  I have also attached the poudriere testport log and portlint -C output for my proposed blender-2.80_1 patch.
Comment 11 Ross McKelvie 2019-08-15 21:06:24 UTC
Created attachment 206598 [details]
poudriere testport log for proposed blender-2.80_1 (gzipped)
Comment 12 Ross McKelvie 2019-08-15 21:08:40 UTC
Created attachment 206599 [details]
portlint -C output for proposed patch blender-2.80_1
Comment 13 Kubilay Kocak freebsd_committer freebsd_triage 2019-08-23 03:39:45 UTC
CC jbeich@, @emaste and @bdrewery as to whether the approach in attachment 206597 [details] is the best/most appropriate one given their involvement/changes to the Mk/bsd.port.mk section on LLD_* and its relevant checks