Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 728764 - >=dev-libs/nss-3.53.1 fails to cross compile with error: unrecognized command line option ‘-m32’; did you mean ‘-mbe32’?
Summary: >=dev-libs/nss-3.53.1 fails to cross compile with error: unrecognized command...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Cross compilation support
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-19 11:56 UTC by tt_1
Modified: 2020-08-23 21:18 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log from cross compiling (build.log,8.46 KB, text/x-log)
2020-06-19 11:56 UTC, tt_1
Details
output from cross-emerge --info (cross-log,4.93 KB, text/plain)
2020-06-19 13:06 UTC, tt_1
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tt_1 2020-06-19 11:56:28 UTC
Created attachment 645244 [details]
build.log from cross compiling

I'm not sure why this happens, =dev-libs/nss-3.52.1-r1 was doing just fine: 



true -m 775 Linux5.4_x86_64_x86_64-pc-linux-gnu-gcc_glibc_PTH_64_OPT.OBJ/nsinstall ../../dist/Linux5.4_x86_64_x86_64-pc-linux-gnu-gcc_glibc_PTH_64_OPT.OBJ/bin
make[1]: Leaving directory '/usr/armv7a-unknown-linux-gnueabihf/tmp/portage/dev-libs/nss-3.53.1/work/nss-3.53.1/nss-.arm/coreconf/nsinstall'
make: Leaving directory '/usr/armv7a-unknown-linux-gnueabihf/tmp/portage/dev-libs/nss-3.53.1/work/nss-3.53.1/nss-.arm/coreconf'
make -j12 -j1 CC=armv7a-unknown-linux-gnueabihf-gcc CCC=armv7a-unknown-linux-gnueabihf-g++ 'AR=armv7a-unknown-linux-gnueabihf-ar rc $@' RANLIB=armv7a-unknown-linux-gnueabihf-ranlib OPTIMIZER= NSINSTALL=/usr/armv7a-unknown-linux-gnueabihf/tmp/portage/dev-libs/nss-3.53.1/work/nss-3.53.1/nss-.arm/./coreconf/nsinstall/Linux5.4_x86_64_x86_64-pc-linux-gnu-gcc_glibc_PTH_64_OPT.OBJ/nsinstall -C . 
make: Entering directory '/usr/armv7a-unknown-linux-gnueabihf/tmp/portage/dev-libs/nss-3.53.1/work/nss-3.53.1/nss-.arm'
coreconf/arch.mk:150: CPU_ARCH is not x86_64, disabling -mavx2
make all
make[1]: Entering directory '/usr/armv7a-unknown-linux-gnueabihf/tmp/portage/dev-libs/nss-3.53.1/work/nss-3.53.1/nss-.arm'
# no real way to encode these in any sensible way
make -C coreconf/nsinstall program
make[2]: Entering directory '/usr/armv7a-unknown-linux-gnueabihf/tmp/portage/dev-libs/nss-3.53.1/work/nss-3.53.1/nss-.arm/coreconf/nsinstall'
armv7a-unknown-linux-gnueabihf-gcc -o Linux5.4_x86_armv7a-unknown-linux-gnueabihf-gcc_glibc_PTH_OPT.OBJ/nsinstall.o -c -std=c99  -fPIC -Di386 -m32 -pipe -ffunction-sections -fdata-sections -DHAVE_STRERROR -DLINUX -Dlinux -Wall -Wshadow -DNSS_NO_GCC48 -DXP_UNIX -UDEBUG -DNDEBUG -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_SOURCE -DSQL_MEASURE_USE_TEMP_DIR -D_REENTRANT -DNSS_DISABLE_AVX2 -DNSS_NO_INIT_SUPPORT -DSEED_ONLY_DEV_URANDOM -DUSE_UTIL_DIRECTLY -DNO_NSPR_10_SUPPORT -DSSL_DISABLE_DEPRECATED_CIPHER_SUITE_NAMES -I../../dist/Linux5.4_x86_armv7a-unknown-linux-gnueabihf-gcc_glibc_PTH_OPT.OBJ/include -I../../dist/public/coreconf -I../../dist/private/coreconf -I../../dist/Linux5.4_x86_armv7a-unknown-linux-gnueabihf-gcc_glibc_PTH_OPT.OBJ/include/dbm -O2 -pipe  -I/usr/armv7a-unknown-linux-gnueabihf/usr/include/nspr nsinstall.c
armv7a-unknown-linux-gnueabihf-gcc: error: unrecognized command line option ‘-m32’; did you mean ‘-mbe32’?
make[2]: *** [../../coreconf/rules.mk:292: Linux5.4_x86_armv7a-unknown-linux-gnueabihf-gcc_glibc_PTH_OPT.OBJ/nsinstall.o] Error 1

but I guess this comes from a confusion of target cc and host cc, since helper tools used during install have to be build for the host, and here it's the target cross cc used for that I believe? 

not sure either if this has anything to do with the bumped patch. 

ideas, anyone?
Comment 1 tt_1 2020-06-19 13:06:29 UTC
Created attachment 645250 [details]
output from cross-emerge --info
Comment 2 David Michael 2020-06-20 14:14:13 UTC
I got a different cross-compiling error when building for PowerPC where it spewed "invalid opcode bswap" messages.  (Maybe I should make a separate bug.)  It seemed to build successfully after appending OS_TEST=ppc to the last emake line.
Comment 3 James Le Cuirot gentoo-dev 2020-06-24 20:00:12 UTC
(In reply to David Michael from comment #2)
> I got a different cross-compiling error when building for PowerPC where it
> spewed "invalid opcode bswap" messages.  (Maybe I should make a separate
> bug.)  It seemed to build successfully after appending OS_TEST=ppc to the
> last emake line.

Grepping the code, I think you're right actually.

Try adding OS_TEST=arm to the last emake and see if that helps.
Comment 4 tt_1 2020-06-24 20:40:00 UTC
hey, thanks for your answer, it's just that I don't understand where to add the OS_Test=arm variable. I tried a few times with different lines and version without success, so can you please post a little patch for me to test it properly?
Comment 5 David Michael 2020-06-28 01:27:29 UTC
You could just add EXTRA_EMAKE=OS_TEST=arm to the environment, which let me cross-compile it for armv7a and armv5tejl.
Comment 6 David Michael 2020-06-29 12:29:43 UTC
This is still an issue with 3.54.
Comment 7 tt_1 2020-07-02 10:20:24 UTC
It might be a good idea to switch to ninja/gyp build in the longterm. For now I can live with the workaround of pasting 

env EXTRA_EMAKE=OS_TEST=arm 

before the cross-emerge wrappers. It was lovely if the value can be dropped into /etc/portage/env/dev-libs/nss , but that didn't seem to work? 


p.s: for arm64 it's OS_TEST=aarch64
Comment 8 Sergei Trofimovich (RETIRED) gentoo-dev 2020-07-02 19:57:51 UTC
(In reply to tt_1 from comment #7)
> before the cross-emerge wrappers. It was lovely if the value can be dropped
> into /etc/portage/env/dev-libs/nss , but that didn't seem to work? 

It should work if you add it to /usr/$CTARGET/etc/portage/env/dev-libs/nss
Comment 9 tt_1 2020-07-02 20:09:41 UTC
no, that doesn't work: 

cat /usr/armv7a-unknown-linux-gnueabihf/etc/portage/env/dev-libs/nss 
EXTRA_EMAKE=OS_TEST=arm 

even though it does for EXTRA_ECONF
Comment 10 David Michael 2020-07-26 14:00:56 UTC
This is still an issue with 3.55.  Can it just be added to the ebuild?

--- dev-libs/nss/nss-3.55.ebuild
+++ dev-libs/nss/nss-3.55.ebuild
@@ -178,7 +178,7 @@
 		CPPFLAGS="${myCPPFLAGS}" \
 		XCFLAGS="${CFLAGS} ${CPPFLAGS}" \
 		NSPR_LIB_DIR="${T}/fakedir" \
-		emake -j1 "${makeargs[@]}" -C ${d}
+		emake -j1 "${makeargs[@]}" -C ${d} OS_TEST="$(nssarch)"
 	done
 }
Comment 11 David Michael 2020-08-23 21:10:11 UTC
This is still an issue with 3.56.  Same problem, same solution.  Is this going to be addressed?
Comment 12 Larry the Git Cow gentoo-dev 2020-08-23 21:18:23 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f980f7e5ed5a164a8d490b34a776590f96c3b5ff

commit f980f7e5ed5a164a8d490b34a776590f96c3b5ff
Author:     Thomas Deutschmann <whissi@gentoo.org>
AuthorDate: 2020-08-23 21:18:06 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2020-08-23 21:18:19 +0000

    dev-libs/nss: fix cross-compile
    
    Closes: https://bugs.gentoo.org/728764
    Package-Manager: Portage-3.0.4, Repoman-3.0.1
    Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>

 dev-libs/nss/nss-3.55.ebuild | 2 +-
 dev-libs/nss/nss-3.56.ebuild | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)