Bug 56653 - Source `src/glsl/builtin_stubs.cpp' not found, needed by target `build/linux-x86_64-debug/glsl/builtin_stubs.o'.
Summary: Source `src/glsl/builtin_stubs.cpp' not found, needed by target `build/linux-...
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Other (show other bugs)
Version: git
Hardware: x86-64 (AMD64) All
: medium blocker
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-02 03:04 UTC by Vinson Lee
Modified: 2016-10-18 06:30 UTC (History)
4 users (show)

See Also:
i915 platform:
i915 features:


Attachments
patch to fix the SCons build by copying the file (1.24 KB, patch)
2012-11-02 05:00 UTC, Kenneth Graunke
Details | Splinter Review
android: Update for builtin_stubs.cpp move (897 bytes, patch)
2012-11-02 11:37 UTC, Thierry Reding
Details | Splinter Review
build: Drop BUILTIN_COMPILER_* variables (2.11 KB, patch)
2012-11-02 11:49 UTC, Thierry Reding
Details | Splinter Review

Description Vinson Lee 2012-11-02 03:04:39 UTC
mesa: 9948a33653088c2b9409f12924857643989657a5 (master)

$ scons
[...]
scons: *** [build/linux-x86_64-debug/glsl/builtin_stubs.o] Source `src/glsl/builtin_stubs.cpp' not found, needed by target `build/linux-x86_64-debug/glsl/builtin_stubs.o'.
scons: building terminated because of errors.

9948a33653088c2b9409f12924857643989657a5 is the first bad commit
commit 9948a33653088c2b9409f12924857643989657a5
Author: Thierry Reding <thierry.reding@avionic-design.de>
Date:   Fri Oct 19 14:03:01 2012 +0200

    build: Don't cross-compile GLSL builtin compiler

    The builtin_compiler binary is used during the build process to generate
    code for the builtin GLSL functions. Since this binary needs to be run
    on the build host, it must not be cross-compiled.

    This patch fixes the build system to compile a second version of the
    source files and the builtin_compiler binary itself for the build
    system. It does so by defining the CC_FOR_BUILD and CXX_FOR_BUILD
    variables, which are searched for by the configure script and point to
    the location of native C and C++ compilers.

    In order for this to work properly, builtin_function.cpp is removed
    from BUILT_SOURCES, otherwise the build system would try to generate it
    before having had a chance to descend into the builtin_compiler
    subdirectory. With the builtin_compiler and glsl_compiler now being
    generated at different stages, the build instructions for glsl_compiler
    can be simplified a bit.

    Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
    Acked-by: Kenneth Graunke <kenneth@whitecape.org>

:100644 100644 6b97a26fc4450b349006a0e4af998046f9370ee6 d42462e493f7e55e73d85994aadd155f0b349a73 M      configure.ac
:040000 040000 b0a3d11622382bd036e54245bc8f777f6668b9cd 90f8bf3a856f7e0e5acb9fb923d22c7b4d7b3748 M      m4
:040000 040000 15151c533ca26c5e33528089408ea098f83021ba 64da7626b652352af5d29667b09ad782b898a5f3 M      src
Comment 1 Kenneth Graunke 2012-11-02 05:00:09 UTC
Created attachment 69412 [details] [review]
patch to fix the SCons build by copying the file

builtin_stubs.cpp has been moved to a subfolder, which broke the SCons build and likely the Android build too.  For some reason, editing Makefile.sources and changing BUILTIN_COMPILER_CXX_FILES to $(GLSL_SRCDIR)/builtin_compiler/builtin_stubs.cpp causes SCons to completely flip out with giant stack traces of doom that make no sense whatsoever.

So...here's a lame patch which copies it back into src/glsl.  It does the job, but it's sure not elegant (and likely doesn't help android at all).
Comment 2 Thierry Reding 2012-11-02 06:43:17 UTC
Darn, I completely forgot to check the SCons and Android builds. I'll take
a look and see if I can come up with something that works for all three
methods.
Comment 3 Jose Fonseca 2012-11-02 11:02:40 UTC
Scons should be fixed with:

commit 8ac4b82699ad0a59ae6ae6d3415702eaa5d4fe3b
Author: José Fonseca <jose.r.fonseca@gmail.com>
Date:   Fri Nov 2 09:42:13 2012 +0000

    scons: Update for builtin_stubs.cpp
    
    Note this by itself is not enough to fix scons build -- it will fail
    until you remove:
    
       rm -rf build/*/glsl/builtin_compiler
    
    because that node was a filei before, but it will be now a directory.
    
    This also means that bisecting across this change will require wiping
    the build directory..

Not sure about android.
Comment 4 Thierry Reding 2012-11-02 11:37:48 UTC
Created attachment 69427 [details] [review]
android: Update for builtin_stubs.cpp move

This is a similar fix to the one José posted for SCons. I haven't tested
this as I don't even remotely know how to setup an environment to build
the Android configuration.
Comment 5 Thierry Reding 2012-11-02 11:49:31 UTC
Created attachment 69429 [details] [review]
build: Drop BUILTIN_COMPILER_* variables

The BUILTIN_COMPILER_CXX_FILES variable is unused and can be dropped.
Files listed in BUILTIN_COMPILER_GENERATED_CXX_FILES are no longer
generated for the builtin compiler but for the GLSL compiler. The
variable is renamed to GLSL_COMPILER_GENERATED_CXX_FILES for
consistency.
Comment 6 Kenneth Graunke 2012-11-02 15:49:45 UTC
Tapani, could you take a look at the Android build?  (Or ask someone else to?)  Thanks! (and sorry for the trouble...)
Comment 7 Tapani Pälli 2012-11-02 16:28:13 UTC
(In reply to comment #6)
> Tapani, could you take a look at the Android build?  (Or ask someone else
> to?)  Thanks! (and sorry for the trouble...)

Sure, no problem
Comment 8 Tapani Pälli 2012-11-02 16:42:11 UTC
yep, build on android broke the same way as scons but gets fixed with Thierry's patch in comment #4

--- 8< ---

i686-linux-g++: error: external/mesa/src/glsl/./builtin_stubs.cpp: No such file or directory
Comment 9 Kenneth Graunke 2012-11-02 17:42:14 UTC
I pushed the patch from #4 which fixes the Android build, and also sent out the patch from #5 for review.

Closing as fixed.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.