Skip to contentSkip to conversation

leveldb: fix compile error with default tune 'mips'

PATCH In review [email protected] 2 participants 2 messages Mar 6, 2019

lore
Share & tools
lore
#0 lore raw

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
index 8fec89c6f..f0e434077 100644
@@ -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
#1 lore raw
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 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 +0 -0
index 8fec89c6f..f0e434077 100644
@@ -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 -0
  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')
+}
+

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 -0
  do_compile() {
      # do not use oe_runmake. oe_runmake pass to make compilation arguments and override
      # leveldb makefile variable CFLAGS and broke leveldb build.