Bug 12951 - trouble building when too long filenames are used in build
Summary: trouble building when too long filenames are used in build
Status: RESOLVED FIXED
Alias: None
Product: uClibc++
Classification: Unclassified
Component: Other (show other bugs)
Version: 0.2.5
Hardware: All Linux
: P3 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-26 03:01 UTC by Wren
Modified: 2020-06-06 05:48 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments
My proposed fix (1.24 KB, patch)
2020-05-26 03:01 UTC, Wren
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Wren 2020-05-26 03:01:05 UTC
Created attachment 8471 [details]
My proposed fix

I was having trouble building uClibc++ in Openwrt. I figured out that the problem was that the LIBSUP_DEP variable, which is a filename that gets created during the build, was too long for my file system. The name generated was over 150 char long and my fs has a limit of 143. I guess this because I have an encrypted homedir. Anyway, I analyzed the build system of uClibc++, and it seems to vary with the file location for libsupc++.a which is used to extract a bunch of symbols and create the static lib. I couldn't think of a reason that the filename needs to vary, so I changed the file to a static name, which was also much shorter. This fixed the problem, and it builds successfully.
Comment 1 Wren 2020-05-26 04:14:35 UTC
My change is also published here:  https://github.com/wt/uClibcpp/tree/fix_libsub_dep_file

Hope this helps.
Comment 2 Bernhard Reutner-Fischer 2020-06-03 23:15:54 UTC
You are suggesting to shorten the current
./src/abi/libsupc/._usr_lib_gcc_x86_64-linux-gnu_9_libsupc++.a.dep
to ./src/abi/libsupc/libsupc++.dep

1) dep files have per convention a leading dot in order not to ruin autocompletion
2) The purpose of these dep files is to record dependencies.
This is done by mixing in the actual compiler used to build the libsupc.

So your proposed patch would break dependency tracking between switching compilers and (respectively) compiler versions.

So this worked before your patch, for example:
make CXX=g++-9
make CXX=g++-10
make CXX=g++-9

With your patch that breaks and you end up with an inconsistent libsupc built into libstdc.

Couple of questions:
1) How does the pristine .dep filename for libsupc++.a look like for you?
Maybe we can remove some sysroot prefix to get at a shorter .dep filename.

2) building in an encrypted home is.. interesting. Maybe build somewhere else?
Comment 3 Bernhard Reutner-Fischer 2020-06-04 09:00:11 UTC
please try current git.

6687fc9276fa52defaf8592f2001c19b826aec93

buildsys: shorten abi dep-file names

certain crypto-layers encode required information in the
filename hence crippling NAME_MAX from 255 down to about 143
ascii chars.

Since the dependency files of libgcc_eh and libsupc encode the full
path to the corresponding libraries, the names of the dep files can
get quite large. Shorten them by some (arbitrary, short) hash.
Comment 4 Wren 2020-06-06 05:48:44 UTC
Seems to work. Thanks.