leveldb: fix compile error with default tune 'mips'
PATCH 1/1 leveldb: fix compile error with default tune 'mips'
From: Kai Kang <[email protected]>
When build leveldb with default tune 'mips', it fails to compile with errors:
| {standard input}: Assembler messages:
| {standard input}:8004: Error: opcode not supported on this processor:
mips1 (mips1) `sync'
| {standard input}:10296: Error: opcode not supported on this processor:
mips1 (mips1) `sync'
| make: *** [out-shared/db/db_bench.o] Error 1
Add 'mips32' to TUNE_FEATURES which eventually add '-march=mips32' to CXX to fix the errors.
--- meta-oe/recipes-dbs/leveldb/leveldb_git.bb | 8 ++++++++ 1 file changed, 8 insertions(+)
meta-oe/recipes-dbs/leveldb/leveldb_git.bb +8 -0
@@ -17,6 +17,14 @@ S = "${WORKDIR}/git" inherit utils +# leveldb fails to compile with default tune 'mips': +# | {standard input}:59226: Error: opcode not supported on this processor: mips1 (mips1) `sync' +# | make: *** [out-shared/db/db_impl.o] Error 1 +python () { + if 'o32' in d.getVar('TUNE_FEATURES') and d.getVar('DEFAULTTUNE') == 'mips': + d.appendVar('TUNE_FEATURES', ' mips32') +} + do_compile() { # do not use oe_runmake. oe_runmake pass to make compilation arguments and override # leveldb makefile variable CFLAGS and broke leveldb build.
Signature · 1 line
2.20.0
Quoted 26 lines · On 3/5/19 5:37 PM, [email protected] wrote:
From: Kai Kang <[email protected]>
When build leveldb with default tune 'mips', it fails to compile with errors:
| {standard input}: Assembler messages:
| {standard input}:8004: Error: opcode not supported on this processor:mips1 (mips1) `sync' | {standard input}:10296: Error: opcode not supported on this processor: mips1 (mips1) `sync'| make: *** [
out-shared/db/db_bench.o] Error 1Add 'mips32' to
TUNE_FEATURESwhich eventually add '-march=mips32' to CXX to fix the errors.Signed-off-by Kai Kang <[email protected]>--- meta-oe/recipes-dbs/leveldb/leveldb_git.bb | 8 ++++++++ 1 file changed, 8 insertions(+)meta-oe/recipes-dbs/leveldb/leveldb_git.bb +0
-0@@ -17,6 +17,14 @@ S = "${WORKDIR}/git"
meta-oe/recipes-dbs/leveldb/leveldb_git.bb S = "${WORKDIR}/git" · line 27
Quoted 10 lines
meta-oe/recipes-dbs/leveldb/leveldb_git.bb +8
-0inherit utils +# leveldb fails to compile with default tune 'mips': +# | {standard input}:59226: Error: opcode not supported on this processor: mips1 (mips1) `sync' +# | make: *** [out-shared/db/db_impl.o] Error 1 +python () { + if 'o32' in d.getVar('TUNE_FEATURES') and d.getVar('DEFAULTTUNE') == 'mips': + d.appendVar('TUNE_FEATURES', ' mips32') +} +
This does not seem to be correct, this patch is forcing a different arch for leveldb, which maybe wrong assumption.
Quoted 4 lines
meta-oe/recipes-dbs/leveldb/leveldb_git.bb +0
-0do_compile() { # do not use oe_runmake. oe_runmake pass to make compilation arguments and override # leveldb makefile variable CFLAGS and broke leveldb build.