Skip to content

Instantly share code, notes, and snippets.

@CedricCabessa
Last active December 12, 2015 06:39
Show Gist options
  • Save CedricCabessa/4730697 to your computer and use it in GitHub Desktop.
Save CedricCabessa/4730697 to your computer and use it in GitHub Desktop.
Patch for android 4.0.4 in order to compile on fedora 18
Index: src.4.0.4/dalvik/vm/native/dalvik_system_Zygote.cpp
===================================================================
--- src.4.0.4.orig/dalvik/vm/native/dalvik_system_Zygote.cpp
+++ src.4.0.4/dalvik/vm/native/dalvik_system_Zygote.cpp
@@ -27,6 +27,8 @@
#include <errno.h>
#include <paths.h>
#include <sys/personality.h>
+#include <sys/time.h>
+#include <sys/resource.h>
#if defined(HAVE_PRCTL)
# include <sys/prctl.h>
Index: src.4.0.4/development/tools/emulator/opengl/host/renderer/Android.mk
===================================================================
--- src.4.0.4.orig/development/tools/emulator/opengl/host/renderer/Android.mk
+++ src.4.0.4/development/tools/emulator/opengl/host/renderer/Android.mk
@@ -5,6 +5,7 @@ $(call emugl-begin-host-executable,emula
$(call emugl-import,libOpenglRender)
LOCAL_SRC_FILES := main.cpp
LOCAL_CFLAGS += -O0 -g
+LOCAL_LDFLAGS += -lX11
#ifeq ($(HOST_OS),windows)
#LOCAL_LDLIBS += -lws2_32
Index: src.4.0.4/development/tools/emulator/opengl/host/tools/emugen/main.cpp
===================================================================
--- src.4.0.4.orig/development/tools/emulator/opengl/host/tools/emugen/main.cpp
+++ src.4.0.4/development/tools/emulator/opengl/host/tools/emugen/main.cpp
@@ -15,6 +15,9 @@
*/
#include <stdio.h>
#include <stdlib.h>
+#include <unistd.h>
+#include <getopt.h>
+
#include "errors.h"
#include "EntryPoint.h"
#include "strUtils.h"
Index: src.4.0.4/external/gtest/include/gtest/internal/gtest-param-util.h
===================================================================
--- src.4.0.4.orig/external/gtest/include/gtest/internal/gtest-param-util.h
+++ src.4.0.4/external/gtest/include/gtest/internal/gtest-param-util.h
@@ -34,6 +34,7 @@
#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
+#include <cstddef>
#include <iterator>
#include <utility>
#include <vector>
Index: src.4.0.4/external/gtest/src/Android.mk
===================================================================
--- src.4.0.4.orig/external/gtest/src/Android.mk
+++ src.4.0.4/external/gtest/src/Android.mk
@@ -49,7 +49,7 @@ LOCAL_SRC_FILES := gtest-all.cc
LOCAL_C_INCLUDES := $(libgtest_host_includes)
-LOCAL_CFLAGS += -O0
+LOCAL_CFLAGS += -O0 -fpermissive
LOCAL_MODULE := libgtest_host
LOCAL_MODULE_TAGS := eng
@@ -67,7 +67,7 @@ LOCAL_SRC_FILES := gtest_main.cc
LOCAL_C_INCLUDES := $(libgtest_host_includes)
-LOCAL_CFLAGS += -O0
+LOCAL_CFLAGS += -O0 -fpermissive
LOCAL_STATIC_LIBRARIES := libgtest
@@ -106,6 +106,7 @@ LOCAL_CPP_EXTENSION := .cc
LOCAL_SRC_FILES := gtest_main.cc
LOCAL_C_INCLUDES := $(libgtest_target_includes)
+LOCAL_CFLAGS += -fpermissive
ifneq ($(BUILD_WITH_ASTL),true)
include external/stlport/libstlport.mk
Index: src.4.0.4/external/mesa3d/src/glsl/linker.cpp
===================================================================
--- src.4.0.4.orig/external/mesa3d/src/glsl/linker.cpp
+++ src.4.0.4/external/mesa3d/src/glsl/linker.cpp
@@ -63,6 +63,7 @@
*
* \author Ian Romanick <ian.d.romanick@intel.com>
*/
+#include <stddef.h>
#include <cstdlib>
#include <cstdio>
#include <cstdarg>
@@ -1762,4 +1763,4 @@ done:
}
//hieralloc_free(mem_ctx);
-}
\ No newline at end of file
+}
Index: src.4.0.4/external/oprofile/libpp/format_output.h
===================================================================
--- src.4.0.4.orig/external/oprofile/libpp/format_output.h
+++ src.4.0.4/external/oprofile/libpp/format_output.h
@@ -91,7 +91,7 @@ protected:
symbol_entry const & symbol;
sample_entry const & sample;
size_t pclass;
- mutable counts_t & counts;
+ /*mutable*/ counts_t & counts;
extra_images const & extra;
double diff;
};
Index: src.4.0.4/external/srec/tools/thirdparty/OpenFst/fst/lib/cache.h
===================================================================
--- src.4.0.4.orig/external/srec/tools/thirdparty/OpenFst/fst/lib/cache.h
+++ src.4.0.4/external/srec/tools/thirdparty/OpenFst/fst/lib/cache.h
@@ -129,11 +129,11 @@ class CacheBaseImpl : public VectorFstBa
while (NumStates() <= s) // Add state to main cache
AddState(0);
if (!VectorFstBaseImpl<S>::GetState(s)) {
- SetState(s, new S);
+ this->SetState(s, new S);
if (cache_first_state_id_ != kNoStateId) { // Forget 1st cached state
while (NumStates() <= cache_first_state_id_)
AddState(0);
- SetState(cache_first_state_id_, cache_first_state_);
+ this->SetState(cache_first_state_id_, cache_first_state_);
if (cache_gc_) {
cache_states_.push_back(cache_first_state_id_);
cache_size_ += sizeof(S) +
@@ -287,7 +287,7 @@ class CacheBaseImpl : public VectorFstBa
(free_recent || !(state->flags & kCacheRecent)) && s != current) {
cache_size_ -= sizeof(S) + state->arcs.capacity() * sizeof(Arc);
delete state;
- SetState(s, 0);
+ this->SetState(s, 0);
cache_states_.erase(siter++);
} else {
state->flags &= ~kCacheRecent;
Index: src.4.0.4/external/srec/tools/thirdparty/OpenFst/fst/lib/compose.h
===================================================================
--- src.4.0.4.orig/external/srec/tools/thirdparty/OpenFst/fst/lib/compose.h
+++ src.4.0.4/external/srec/tools/thirdparty/OpenFst/fst/lib/compose.h
@@ -128,7 +128,7 @@ class ComposeFstImplBase : public CacheI
if (!HasStart()) {
StateId start = ComputeStart();
if (start != kNoStateId) {
- SetStart(start);
+ this->SetStart(start);
}
}
return CacheImpl<A>::Start();
@@ -137,7 +137,7 @@ class ComposeFstImplBase : public CacheI
Weight Final(StateId s) {
if (!HasFinal(s)) {
Weight final = ComputeFinal(s);
- SetFinal(s, final);
+ this->SetFinal(s, final);
}
return CacheImpl<A>::Final(s);
}
@@ -583,7 +583,7 @@ class ComposeFstImpl : public ComposeFst
AddArc(s, earca, arcb, numepsa > 0, find_input); // move on epsilon
}
}
- SetArcs(s);
+ this->SetArcs(s);
}
Index: src.4.0.4/external/srec/tools/thirdparty/OpenFst/fst/lib/determinize.h
===================================================================
--- src.4.0.4.orig/external/srec/tools/thirdparty/OpenFst/fst/lib/determinize.h
+++ src.4.0.4/external/srec/tools/thirdparty/OpenFst/fst/lib/determinize.h
@@ -148,7 +148,7 @@ class DeterminizeFstImplBase : public Ca
if (!HasStart()) {
StateId start = ComputeStart();
if (start != kNoStateId) {
- SetStart(start);
+ this->SetStart(start);
}
}
return CacheImpl<A>::Start();
@@ -157,7 +157,7 @@ class DeterminizeFstImplBase : public Ca
Weight Final(StateId s) {
if (!HasFinal(s)) {
Weight final = ComputeFinal(s);
- SetFinal(s, final);
+ this->SetFinal(s, final);
}
return CacheImpl<A>::Final(s);
}
@@ -294,7 +294,7 @@ class DeterminizeFsaImpl : public Determ
liter != label_map.end();
++liter)
AddArc(s, liter->first, liter->second);
- SetArcs(s);
+ this->SetArcs(s);
}
private:
Index: src.4.0.4/external/srec/tools/thirdparty/OpenFst/fst/lib/factor-weight.h
===================================================================
--- src.4.0.4.orig/external/srec/tools/thirdparty/OpenFst/fst/lib/factor-weight.h
+++ src.4.0.4/external/srec/tools/thirdparty/OpenFst/fst/lib/factor-weight.h
@@ -180,7 +180,7 @@ class FactorWeightFstImpl
if (s == kNoStateId)
return kNoStateId;
StateId start = FindState(Element(fst_->Start(), Weight::One()));
- SetStart(start);
+ this->SetStart(start);
}
return CacheImpl<A>::Start();
}
@@ -194,9 +194,9 @@ class FactorWeightFstImpl
: (Weight) Times(e.weight, fst_->Final(e.state));
FactorIterator f(w);
if (w != Weight::Zero() && f.Done())
- SetFinal(s, w);
+ this->SetFinal(s, w);
else
- SetFinal(s, Weight::Zero());
+ this->SetFinal(s, Weight::Zero());
}
return CacheImpl<A>::Final(s);
}
@@ -263,13 +263,13 @@ class FactorWeightFstImpl
FactorIterator fit(w);
if (final_only_ || fit.Done()) {
StateId d = FindState(Element(arc.nextstate, Weight::One()));
- AddArc(s, Arc(arc.ilabel, arc.olabel, w, d));
+ this->AddArc(s, Arc(arc.ilabel, arc.olabel, w, d));
} else {
for (; !fit.Done(); fit.Next()) {
const pair<Weight, Weight> &p = fit.Value();
StateId d = FindState(Element(arc.nextstate,
p.second.Quantize(delta_)));
- AddArc(s, Arc(arc.ilabel, arc.olabel, p.first, d));
+ this->AddArc(s, Arc(arc.ilabel, arc.olabel, p.first, d));
}
}
}
@@ -285,10 +285,10 @@ class FactorWeightFstImpl
const pair<Weight, Weight> &p = fit.Value();
StateId d = FindState(Element(kNoStateId,
p.second.Quantize(delta_)));
- AddArc(s, Arc(0, 0, p.first, d));
+ this->AddArc(s, Arc(0, 0, p.first, d));
}
}
- SetArcs(s);
+ this->SetArcs(s);
}
private:
Index: src.4.0.4/external/srec/tools/thirdparty/OpenFst/fst/lib/map.h
===================================================================
--- src.4.0.4.orig/external/srec/tools/thirdparty/OpenFst/fst/lib/map.h
+++ src.4.0.4/external/srec/tools/thirdparty/OpenFst/fst/lib/map.h
@@ -294,7 +294,7 @@ class MapFstImpl : public CacheImpl<B> {
StateId Start() {
if (!HasStart())
- SetStart(FindOState(fst_->Start()));
+ this->SetStart(FindOState(fst_->Start()));
return CacheImpl<B>::Start();
}
@@ -306,24 +306,24 @@ class MapFstImpl : public CacheImpl<B> {
B final_arc = (*mapper_)(A(0, 0, fst_->Final(FindIState(s)),
kNoStateId));
CHECK(final_arc.ilabel == 0 && final_arc.olabel == 0);
- SetFinal(s, final_arc.weight);
+ this->SetFinal(s, final_arc.weight);
break;
}
case MAP_ALLOW_SUPERFINAL: {
if (s == superfinal_) {
- SetFinal(s, Weight::One());
+ this->SetFinal(s, Weight::One());
} else {
B final_arc = (*mapper_)(A(0, 0, fst_->Final(FindIState(s)),
kNoStateId));
if (final_arc.ilabel == 0 && final_arc.olabel == 0)
- SetFinal(s, final_arc.weight);
+ this->SetFinal(s, final_arc.weight);
else
- SetFinal(s, Weight::Zero());
+ this->SetFinal(s, Weight::Zero());
}
break;
}
case MAP_REQUIRE_SUPERFINAL: {
- SetFinal(s, s == superfinal_ ? Weight::One() : Weight::Zero());
+ this->SetFinal(s, s == superfinal_ ? Weight::One() : Weight::Zero());
break;
}
}
@@ -357,14 +357,14 @@ class MapFstImpl : public CacheImpl<B> {
void Expand(StateId s) {
// Add exiting arcs.
- if (s == superfinal_) { SetArcs(s); return; }
+ if (s == superfinal_) { this->SetArcs(s); return; }
for (ArcIterator< Fst<A> > aiter(*fst_, FindIState(s));
!aiter.Done(); aiter.Next()) {
A aarc(aiter.Value());
aarc.nextstate = FindOState(aarc.nextstate);
const B& barc = (*mapper_)(aarc);
- AddArc(s, barc);
+ this->AddArc(s, barc);
}
// Check for superfinal arcs.
@@ -380,7 +380,7 @@ class MapFstImpl : public CacheImpl<B> {
if (superfinal_ == kNoStateId)
superfinal_ = nstates_++;
final_arc.nextstate = superfinal_;
- AddArc(s, final_arc);
+ this->AddArc(s, final_arc);
}
break;
}
@@ -389,12 +389,12 @@ class MapFstImpl : public CacheImpl<B> {
kNoStateId));
if (final_arc.ilabel != 0 || final_arc.olabel != 0 ||
final_arc.weight != B::Weight::Zero())
- AddArc(s, B(final_arc.ilabel, final_arc.olabel,
+ this->AddArc(s, B(final_arc.ilabel, final_arc.olabel,
final_arc.weight, superfinal_));
break;
}
}
- SetArcs(s);
+ this->SetArcs(s);
}
private:
Index: src.4.0.4/external/srec/tools/thirdparty/OpenFst/fst/lib/vector-fst.h
===================================================================
--- src.4.0.4.orig/external/srec/tools/thirdparty/OpenFst/fst/lib/vector-fst.h
+++ src.4.0.4/external/srec/tools/thirdparty/OpenFst/fst/lib/vector-fst.h
@@ -197,9 +197,9 @@ class VectorFstImpl : public VectorFstBa
static VectorFstImpl<A> *Read(istream &strm, const FstReadOptions &opts);
- size_t NumInputEpsilons(StateId s) const { return GetState(s)->niepsilons; }
+ size_t NumInputEpsilons(StateId s) const { return this->GetState(s)->niepsilons; }
- size_t NumOutputEpsilons(StateId s) const { return GetState(s)->noepsilons; }
+ size_t NumOutputEpsilons(StateId s) const { return this->GetState(s)->noepsilons; }
bool Write(ostream &strm, const FstWriteOptions &opts) const;
@@ -211,7 +211,7 @@ class VectorFstImpl : public VectorFstBa
}
void SetFinal(StateId s, Weight w) {
- Weight ow = Final(s);
+ Weight ow = this->Final(s);
if (ow != Weight::Zero() && ow != Weight::One())
SetProperties(Properties() & ~kWeighted);
BaseImpl::SetFinal(s, w);
@@ -230,7 +230,7 @@ class VectorFstImpl : public VectorFstBa
}
void AddArc(StateId s, const A &arc) {
- VectorState<A> *state = GetState(s);
+ VectorState<A> *state = this->GetState(s);
if (arc.ilabel != arc.olabel) {
SetProperties(Properties() | kNotAcceptor);
SetProperties(Properties() & ~kAcceptor);
@@ -288,21 +288,21 @@ class VectorFstImpl : public VectorFstBa
}
void DeleteArcs(StateId s, size_t n) {
- const vector<A> &arcs = GetState(s)->arcs;
+ const vector<A> &arcs = this->GetState(s)->arcs;
for (size_t i = 0; i < n; ++i) {
size_t j = arcs.size() - i - 1;
if (arcs[j].ilabel == 0)
- --GetState(s)->niepsilons;
+ --this->GetState(s)->niepsilons;
if (arcs[j].olabel == 0)
- --GetState(s)->noepsilons;
+ --this->GetState(s)->noepsilons;
}
BaseImpl::DeleteArcs(s, n);
SetProperties(Properties() & kDeleteArcsProperties);
}
void DeleteArcs(StateId s) {
- GetState(s)->niepsilons = 0;
- GetState(s)->noepsilons = 0;
+ this->GetState(s)->niepsilons = 0;
+ this->GetState(s)->noepsilons = 0;
BaseImpl::DeleteArcs(s);
SetProperties(Properties() & kDeleteArcsProperties);
}
@@ -322,8 +322,8 @@ template <class A>
VectorFstImpl<A>::VectorFstImpl(const Fst<A> &fst) {
SetType("vector");
SetProperties(fst.Properties(kCopyProperties, false) | kStaticProperties);
- SetInputSymbols(fst.InputSymbols());
- SetOutputSymbols(fst.OutputSymbols());
+ this->SetInputSymbols(fst.InputSymbols());
+ this->SetOutputSymbols(fst.OutputSymbols());
BaseImpl::SetStart(fst.Start());
for (StateIterator< Fst<A> > siter(fst);
@@ -332,16 +332,16 @@ VectorFstImpl<A>::VectorFstImpl(const Fs
StateId s = siter.Value();
BaseImpl::AddState();
BaseImpl::SetFinal(s, fst.Final(s));
- ReserveArcs(s, fst.NumArcs(s));
+ this->ReserveArcs(s, fst.NumArcs(s));
for (ArcIterator< Fst<A> > aiter(fst, s);
!aiter.Done();
aiter.Next()) {
const A &arc = aiter.Value();
BaseImpl::AddArc(s, arc);
if (arc.ilabel == 0)
- ++GetState(s)->niepsilons;
+ ++this->GetState(s)->niepsilons;
if (arc.olabel == 0)
- ++GetState(s)->noepsilons;
+ ++this->GetState(s)->noepsilons;
}
}
}
@@ -427,7 +427,7 @@ bool VectorFstImpl<A>::Write(ostream &st
return false;
for (StateId s = 0; s < NumStates(); ++s) {
- const VectorState<A> *state = GetState(s);
+ const VectorState<A> *state = this->GetState(s);
state->final.Write(strm);
int64 narcs = state->arcs.size();
WriteType(strm, narcs);
Index: src.4.0.4/frameworks/base/include/utils/KeyedVector.h
===================================================================
--- src.4.0.4.orig/frameworks/base/include/utils/KeyedVector.h
+++ src.4.0.4/frameworks/base/include/utils/KeyedVector.h
@@ -122,7 +122,7 @@ ssize_t KeyedVector<KEY,VALUE>::indexOfK
template<typename KEY, typename VALUE> inline
const VALUE& KeyedVector<KEY,VALUE>::valueFor(const KEY& key) const {
- ssize_t i = indexOfKey(key);
+ ssize_t i = this->indexOfKey(key);
assert(i>=0);
return mVector.itemAt(i).value;
}
@@ -139,7 +139,7 @@ const KEY& KeyedVector<KEY,VALUE>::keyAt
template<typename KEY, typename VALUE> inline
VALUE& KeyedVector<KEY,VALUE>::editValueFor(const KEY& key) {
- ssize_t i = indexOfKey(key);
+ ssize_t i = this->indexOfKey(key);
assert(i>=0);
return mVector.editItemAt(i).value;
}
@@ -190,7 +190,7 @@ DefaultKeyedVector<KEY,VALUE>::DefaultKe
template<typename KEY, typename VALUE> inline
const VALUE& DefaultKeyedVector<KEY,VALUE>::valueFor(const KEY& key) const {
- ssize_t i = indexOfKey(key);
+ ssize_t i = this->indexOfKey(key);
return i >= 0 ? KeyedVector<KEY,VALUE>::valueAt(i) : mDefault;
}
Index: src.4.0.4/frameworks/compile/slang/Android.mk
===================================================================
--- src.4.0.4.orig/frameworks/compile/slang/Android.mk
+++ src.4.0.4/frameworks/compile/slang/Android.mk
@@ -19,7 +19,7 @@ ifeq ($(TARGET_BUILD_APPS),)
LOCAL_PATH := $(call my-dir)
-local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter -Werror
+local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter
ifneq ($(TARGET_BUILD_VARIANT),eng)
local_cflags_for_slang += -D__DISABLE_ASSERTS
endif
Index: src.4.0.4/external/srec/tools/thirdparty/OpenFst/fst/lib/const-fst.h
===================================================================
--- src.4.0.4.orig/external/srec/tools/thirdparty/OpenFst/fst/lib/const-fst.h
+++ src.4.0.4/external/srec/tools/thirdparty/OpenFst/fst/lib/const-fst.h
@@ -119,8 +119,8 @@ ConstFstImpl<A>::ConstFstImpl(const Fst<
SetType("const");
uint64 copy_properties = fst.Properties(kCopyProperties, true);
SetProperties(copy_properties | kStaticProperties);
- SetInputSymbols(fst.InputSymbols());
- SetOutputSymbols(fst.OutputSymbols());
+ this->SetInputSymbols(fst.InputSymbols());
+ this->SetOutputSymbols(fst.OutputSymbols());
start_ = fst.Start();
// count # of states and arcs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment