Summary: | archivers/liblz4: setting TARGET_ARCH variable prevent to compile | ||||||
---|---|---|---|---|---|---|---|
Product: | Ports & Packages | Reporter: | Olivier Cochard <olivier> | ||||
Component: | Individual Port(s) | Assignee: | Olivier Cochard <olivier> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Some People | CC: | linimon, ports-bugs, w.schwarzenfeld | ||||
Priority: | --- | Flags: | martin:
maintainer-feedback+
|
||||
Version: | Latest | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
Attachments: |
|
Cannot reproduce this error. (In reply to Olivier Cochard from comment #0) Olivier, can you give me more details? For instance, what architecture are you running on when trying to cross-build for amd64? This may be similar to 214778. I would have to see an errorlog to make sure. Here a full build log: root@lame4:/usr/ports/archivers/liblz4 # uname -a FreeBSD lame4.bsdrp.net 12.0-CURRENT FreeBSD 12.0-CURRENT #5 r328114: Thu Jan 18 11:22:16 CET 2018 olivier@lame4.bsdrp.net:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG amd64 root@lame4:/usr/ports/archivers/liblz4 # make clean ===> Cleaning for liblz4-1.8.1.2,1 root@lame4:/usr/ports/archivers/liblz4 # env 'TARGET_ARCH=amd64' make ===> License BSD2CLAUSE GPLv2 accepted by the user ===> liblz4-1.8.1.2,1 depends on file: /usr/local/sbin/pkg - found ===> Fetching all distfiles required by liblz4-1.8.1.2,1 for building ===> Extracting for liblz4-1.8.1.2,1 => SHA256 Checksum OK for lz4-lz4-v1.8.1.2_GH0.tar.gz. ===> Patching for liblz4-1.8.1.2,1 ===> liblz4-1.8.1.2,1 depends on executable: gmake - found ===> liblz4-1.8.1.2,1 depends on package: pkgconf>=1.3.0_1 - found ===> Configuring for liblz4-1.8.1.2,1 ===> Building for liblz4-1.8.1.2,1 gmake[1]: Entering directory '/usr/local/poudriere/ports/default/archivers/liblz4/work/lz4-1.8.1.2' gmake[2]: Entering directory '/usr/local/poudriere/ports/default/archivers/liblz4/work/lz4-1.8.1.2/lib' compiling static library compiling dynamic library 1.8.1 creating versioned links gmake[2]: Leaving directory '/usr/local/poudriere/ports/default/archivers/liblz4/work/lz4-1.8.1.2/lib' gmake[2]: Entering directory '/usr/local/poudriere/ports/default/archivers/liblz4/work/lz4-1.8.1.2/programs' cc -O2 -pipe -fstack-protector -fno-strict-aliasing -I../lib -DXXH_NAMESPACE=LZ4_ amd64 -c -o bench.o bench.c cc -O2 -pipe -fstack-protector -fno-strict-aliasing -I../lib -DXXH_NAMESPACE=LZ4_ amd64 -c -o datagen.o datagen.c cc -O2 -pipe -fstack-protector -fno-strict-aliasing -I../lib -DXXH_NAMESPACE=LZ4_ amd64 -c -o lz4cli.o lz4cli.c cc -O2 -pipe -fstack-protector -fno-strict-aliasing -I../lib -DXXH_NAMESPACE=LZ4_ amd64 -c -o lz4io.o lz4io.c cc: error: no such file or directory: 'amd64' cc: error: no such file or directory: 'amd64' cc: error: no such file or directory: 'amd64' gmake[2]: *** [<builtin>: bench.o] Error 1 gmake[2]: *** Waiting for unfinished jobs.... gmake[2]: *** [<builtin>: datagen.o] Error 1 gmake[2]: *** [<builtin>: lz4cli.o] Error 1 cc: error: no such file or directory: 'amd64' gmake[2]: *** [<builtin>: lz4io.o] Error 1 gmake[2]: Leaving directory '/usr/local/poudriere/ports/default/archivers/liblz4/work/lz4-1.8.1.2/programs' gmake[1]: *** [Makefile:68: lz4-release] Error 2 gmake[1]: Leaving directory '/usr/local/poudriere/ports/default/archivers/liblz4/work/lz4-1.8.1.2' ===> Compilation failed unexpectedly. Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to the maintainer. *** Error code 1 Stop. make: stopped in /usr/local/poudriere/ports/default/archivers/liblz4 (In reply to Olivier Cochard from comment #4) Thank you, Olivier, I was able to reproduce the described error. Also, your patch does 'solve' the issue, but by forcibly unsetting the environment variable so that, in the end, running env 'TARGET_ARCH=armv6' make env 'TARGET_ARCH=i386' make env 'TARGET_ARCH=amd64' make all result in the very same library being built (namely the version for the arch you are running on): file /usr/ports/archivers/liblz4/work/stage/usr/local/lib/liblz4.so.1.8.1 /usr/ports/archivers/liblz4/work/stage/usr/local/lib/liblz4.so.1.8.1: ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, stripped I am all for improving the port, but this looks very wrong to me. All the same, I'll dig into this some more and get back to you. Martin env 'TARGET_ARCH=amd64' && make ^^ (In reply to w.schwarzenfeld from comment #6) Thanks Walter, Doing that I also do not get any error. Is the error then (only) in the syntax Oliver used? (quoting from comment #4): root@lame4:/usr/ports/archivers/liblz4 # env 'TARGET_ARCH=amd64' make I am not sure. If I try it with poudriere: it fails with .if ${.CURDIR:M/*ports/archivers/liblz4} CONFIGURE_ENV+= TARGET_ARCH=amd64 MAKE_ENV+= TARGET_ARCH=amd64 .endif Builds with success with .if ${.CURDIR:M/*ports/archivers/liblz4} TARGET_ARCH= amd64 .endif but: the log shows: #### /usr/ports/Mk/Scripts/ports_env.sh #### _CCVERSION_921dbbb2=FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512 Targe t: x86_64-unknown-freebsd10.4 Thread model: posix _ALTCCVERSION_921dbbb2=none _CXXINTERNAL_acaad9ca=FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512 Tar get: x86_64-unknown-freebsd10.4 Thread model: posix "/usr/bin/ld" "--eh-frame-hdr" "-dynamic-linke r" "/libexec/ld-elf.so.1" "--hash-style=both" "--enable-new-dtags" "-o" "a.out" "/usr/lib/crt1.o" "/usr/lib/crti.o" "/usr/lib/crtbegin.o" "-L/usr/lib" "/dev/null" "-lc++" "-lm" "-lgcc" "--as-neede d" "-lgcc_s" "--no-as-needed" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "/usr/lib/crt end.o" "/usr/lib/crtn.o" OUTPUT_58173849_921dbbb2=yes OUTPUT_9bdba57c_921dbbb2=yes OUTPUT_6a4fe7f5_921dbbb2=yes OUTPUT_6bcac02b_921dbbb2=yes OUTPUT_67d20829_921dbbb2=yes OUTPUT_bfa62e83_921dbbb2=yes OUTPUT_f0b4d593_921dbbb2=yes OUTPUT_308abb44_921dbbb2=yes OUTPUT_f00456e5_921dbbb2=yes OUTPUT_65ad290d_921dbbb2=error: invalid value 'c++14' in '-std=c++14' yes OUTPUT_b2657cc3_921dbbb2=yes OUTPUT_380987f7_921dbbb2=yes ARCH=amd64 OPSYS=FreeBSD _OSRELEASE=10.4-RELEASE-p5 OSREL=10.4 OSVERSION=1004000 : get: x86_64-unknown-freebsd10.4 Thread model: posix "/usr/bin/ld" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld-elf.so.1" "--hash-style=both" "--enable-new-dtags" "-o" "a.out" "/usr/lib/crt1.o" "/usr/lib/crti.o" "/usr/lib/crtbegin.o" "-L/usr/lib" "/dev/null" "-lc++" "-lm" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "/usr/lib/crtend.o" "/usr/lib/crtn.o" OUTPUT_58173849_921dbbb2=yes OUTPUT_9bdba57c_921dbbb2=yes OUTPUT_6a4fe7f5_921dbbb2=yes OUTPUT_6bcac02b_921dbbb2=yes OUTPUT_67d20829_921dbbb2=yes OUTPUT_bfa62e83_921dbbb2=yes OUTPUT_f0b4d593_921dbbb2=yes OUTPUT_308abb44_921dbbb2=yes OUTPUT_f00456e5_921dbbb2=yes OUTPUT_65ad290d_921dbbb2=error: invalid value 'c++14' in '-std=c++14' yes OUTPUT_b2657cc3_921dbbb2=yes OUTPUT_380987f7_921dbbb2=yes ARCH=amd64 OPSYS=FreeBSD _OSRELEASE=10.4-RELEASE-p5 OSREL=10.4 Oh, this was my error. Wrong clang version. Build with poudriere with clang60 fine. I think env takes "make" as second argument. So it is not a command. Found this: Bug #165480. Here also as in the attachment: You have first to set in the Makefile MAKE_ENV+= TARGET_ARCH= Comment on attachment 189963 [details]
Patch fixing call with TARGET_ARCH
patch accepted
(In reply to Olivier Cochard from comment #0) Olivier, can you please request approval for your patch, otherwise bugzilla does not allow me to give approval. Thanks, Martin (In reply to Martin Waschbüsch from comment #13) Your previous message "patch accepted" is enough I believe: I will commit it. ping! resp. I this still relevant? Yes, it still relevant... but by reading the backlog, it seems it was my job to commit it and I forget to do it, right? Yes, seems right. A commit references this bug: Author: olivier Date: Thu Feb 14 14:49:19 UTC 2019 New revision: 492921 URL: https://svnweb.freebsd.org/changeset/ports/492921 Log: Fix compilation when TARGET_ARCH is set PR: 225377 Approved by: Martin Waschb?sch (maintainer) Changes: head/archivers/liblz4/Makefile Sorry to forgot to commit this patch lot's sooner. |
Created attachment 189963 [details] Patch fixing call with TARGET_ARCH If you set TARGET_ARCH, like 'TARGET_ARCH=amd64', the port didn't compile any-more and fail with these error messages: cc: error: no such file or directory: 'amd64' cc: error: no such file or directory: 'amd64' A proposal fix is attached.