linker - ar on MSYS2 shell receives truncated paths when called from Makefile? -


i'm using git-bash.exe portablegit install, environment variables different mingw. have:

workgroup+user@ad-x mingw32 /z/user/downloads $ ar //workgroup.ex.com/users/user/downloads/mingw-w64/i686-4.9.3-posix-dwarf-rt_v4-rev1/mingw32/bin/ar  workgroup+user@ad-x mingw32 /z/user/downloads $ gcc --version | head -1 gnu ar (gnu binutils) 2.25 

now there's library i'm building, , @ end, link step fails @ call of ar command, looks this:

ar -cr "z:/user/downloads/myprojectnameabcde/somelibraryabc/libs/somelibrarydefghi/lib/mingw/libsomelibraryabcdebug.a" \ z:/user/downloads/myprojectnameabcde/somelibraryabc/libs/somelibrarydefghi/lib/mingw/obj/debug/libs/somelibrarydefghi/test/someobject.o \ [...] 

... , there's bunch of objects listed in - command line 10000 characters in length, still below getconf arg_max of 32000 in msys2 shell of portablegit (git-bash.exe). however, failure no such file or directory:

\\workgroup.ex.com\users\user\downloads\mingw-w64\i686-4.9.3-posix-dwarf-rt_v4-rev1\mingw32\bin\ar.exe: z:/user/downloads/myprojectnameabcde/somelibraryabc/libs/somelibrarydefghi/lib/mingw/obj/debug/libs/some: no such file or directory 

... , path given quite truncated version of path object files are. what's stranger, when copy full ar command line printed make process, , paste in same terminal, completes without error?

would have idea why happens, , make sure ar completes when called makefile?

ok, first found in makefile ar command ran, , added -v switch (so, -crv) verbose.

i find of command line read, , objects added, until comes 8192 bytes of command line, after truncated, , failure occurs. apparently known issue:

... although, i'm not quite clear on why should appear in make process runs in git-bash.exe, is, msys2 shell ?!

anyways, workaround/fix used use file option of make, since doing "@echo $cmd > arscript.sh" makefile again save 8kb truncated command line file; instead of original call:

    @$(ar) ${flags_for_ar} "$@" $(files_for_ar) 

... save line file, , call bash interpret script; is:

    $(file >arscript.sh,@$(ar) ${flags_for_ar} "$@" $(files_for_ar))     bash -x arscript.sh 

... , worked me.


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -