From ccb522a4659fb31b8cd8f05f40935f37242e6b64 Mon Sep 17 00:00:00 2001 From: Lars Bergstrom Date: Tue, 1 Apr 2014 11:47:41 -0500 Subject: [PATCH 1/3] Android fixes for February Rust Upgrade --- Makefile.in | 14 ++--- src/compiler/rust | 2 +- src/components/gfx/gfx.rs | 2 + src/components/main/layout/context.rs | 70 +++++++++++++++++++++++++ src/components/msg/msg.rs | 2 + src/components/net/net.rs | 2 + src/components/script/script.rs | 2 + src/components/style/style.rs | 2 + src/components/util/util.rs | 2 + src/platform/android/servo-android-glue | 2 +- src/support/egl/rust-egl | 2 +- src/support/glut/rust-glut | 2 +- src/support/harfbuzz/rust-harfbuzz | 2 +- src/support/stb-image/rust-stb-image | 2 +- 14 files changed, 96 insertions(+), 12 deletions(-) diff --git a/Makefile.in b/Makefile.in index e96fac06955..e47d942b165 100644 --- a/Makefile.in +++ b/Makefile.in @@ -131,6 +131,8 @@ endif # their name already, while others don't. DONE_$(1) = $$(B)src/$$(PATH_$(1))/lib*.dummy DEPS_SUBMODULES += $$(PATH_$(1)) +DEPS_SUBMODULES += $$(PATH_$(1))/.libs +DEPS_SUBMODULES += $$(PATH_$(1))/src/.libs endef # these will get populated. @@ -157,7 +159,7 @@ endef define DEF_SUBMODULE_RULES ENV_RLDFLAGS_$(1) = -L $$(CFG_BUILD_HOME)workspace/lib/$$(CFG_TARGET_TRIPLES) -ENV_RLDFLAGS_$(1) += $$(foreach dep,$$(DEPS_$(1)),-L $$(B)src/$$(PATH_$$(dep))) +ENV_RLDFLAGS_$(1) += $$(foreach dep,$$(DEPS_$(1)),-L $$(B)src/$$(PATH_$$(dep)) -L $$(B)src/$$(PATH_$$(dep))/.libs -L $$(B)src/$$(PATH_$$(dep))/src/.libs) # variables that depend on dependency definitions from sub.mk! ENV_CFLAGS_$(1) = CFLAGS="$$(CFLAGS_$(1))" @@ -336,7 +338,8 @@ servo: $(DEPS_servo) else servo: $(DEPS_servo) @$(call E, compile: $@) - $(Q)$(RUSTC) $(RFLAGS_servo) -C gen-crate-map -o $@ $< --crate-type lib + $(Q)$(RUSTC) $(RFLAGS_servo) -C gen-crate-map $< -o libservo.so --crate-type dylib + touch servo endif # Darwin app packaging @@ -354,12 +357,11 @@ package: servo else ifeq ($(CFG_OSTYPE),linux-androideabi) package: servo mkdir -p sofile - -exec cp -f {} $(CFG_BUILD_HOME)sofile \; - find . ! \( \( -type d -path './sofile' -o -path './$(CFG_TARGET_TRIPLES)/src/compiler/rust' \) -prune \) -name '*.so' -type f | xargs cp -f -t $(CFG_BUILD_HOME)sofile - find $(CFG_RUST_HOME)/lib/rustc/$(CFG_TARGET_TRIPLES)/lib/ -name '*.so' -type f -size +1c | xargs cp -f -t $(CFG_BUILD_HOME)sofile + find . ! \( \( -type d -path './sofile' -o -path './$(CFG_TARGET_TRIPLES)/src/compiler/rust' \) -prune \) -name '*.so' -type f | xargs -I {} cp -f {} $(CFG_BUILD_HOME)sofile/ + find $(CFG_RUST_HOME)/lib/rustlib/$(CFG_TARGET_TRIPLES)/lib/ -name '*.so' -type f -size +1c | xargs -I {} cp -f {} $(CFG_BUILD_HOME)sofile/ cd $(S)src/platform/android/servo-android-glue && make with-libs cd $(CFG_BUILD_HOME) - cp $(S)src/platform/android/servo-android-glue/bin/ServoAndroid-debug.apk -t $(CFG_BUILD_HOME) + cp $(S)src/platform/android/servo-android-glue/bin/ServoAndroid-debug.apk $(CFG_BUILD_HOME) else diff --git a/src/compiler/rust b/src/compiler/rust index aa39d755e3f..d6811bc1bde 160000 --- a/src/compiler/rust +++ b/src/compiler/rust @@ -1 +1 @@ -Subproject commit aa39d755e3f9823b51cc57761c0c8c75759aca2e +Subproject commit d6811bc1bdeb66381af4b9bf3e4ff77b3cee27f6 diff --git a/src/components/gfx/gfx.rs b/src/components/gfx/gfx.rs index de02ece7fbd..1af989fbad1 100644 --- a/src/components/gfx/gfx.rs +++ b/src/components/gfx/gfx.rs @@ -4,6 +4,8 @@ #[crate_id = "github.com/mozilla/servo#gfx:0.1"]; #[crate_type = "lib"]; +#[crate_type = "dylib"]; +#[crate_type = "rlib"]; #[feature(globs, managed_boxes, macro_rules, phase)]; diff --git a/src/components/main/layout/context.rs b/src/components/main/layout/context.rs index 1b13470ed30..041f6747abd 100644 --- a/src/components/main/layout/context.rs +++ b/src/components/main/layout/context.rs @@ -24,17 +24,32 @@ use style::{ComputedValues, Stylist}; use sync::{Arc, MutexArc}; use url::Url; +#[cfg(target_os="android")] +use std::local_data; + +#[cfg(not(target_os="android"))] #[thread_local] static mut FONT_CONTEXT: *mut FontContext = 0 as *mut FontContext; +#[cfg(target_os="android")] +local_data_key!(font_context: * mut FontContext) + +#[cfg(not(target_os="android"))] #[thread_local] static mut APPLICABLE_DECLARATIONS_CACHE: *mut ApplicableDeclarationsCache = 0 as *mut ApplicableDeclarationsCache; +#[cfg(target_os="android")] +local_data_key!(applicable_declarations_cache: * mut ApplicableDeclarationsCache) + +#[cfg(not(target_os="android"))] #[thread_local] static mut STYLE_SHARING_CANDIDATE_CACHE: *mut StyleSharingCandidateCache = 0 as *mut StyleSharingCandidateCache; +#[cfg(target_os="android")] +local_data_key!(style_sharing_candidate_cache: * mut StyleSharingCandidateCache) + /// Data shared by all layout workers. #[deriving(Clone)] pub struct LayoutContext { @@ -71,6 +86,7 @@ pub struct LayoutContext { opts: Opts, } +#[cfg(not(target_os="android"))] impl LayoutContext { pub fn font_context<'a>(&'a mut self) -> &'a mut FontContext { // Sanity check. @@ -139,3 +155,57 @@ impl LayoutContext { } } + +// On Android, we don't have the __tls_* functions emitted by rustc, so we +// need to use the slower local_data functions. +// Making matters worse, the local_data functions are very particular about +// enforcing the lifetimes associated with objects that they hold onto, +// which causes us some trouble we work around as below. +#[cfg(target_os="android")] +impl LayoutContext { + pub fn font_context<'a>(&'a mut self) -> &'a mut FontContext { + unsafe { + let opt = local_data::pop(font_context); + let mut context; + match opt { + Some(c) => context = cast::transmute(c), + None => { + context = cast::transmute(~FontContext::new(self.font_context_info.clone())) + } + } + local_data::set(font_context, context); + cast::transmute(context) + } + } + + pub fn applicable_declarations_cache<'a>(&'a self) -> &'a mut ApplicableDeclarationsCache { + unsafe { + let opt = local_data::pop(applicable_declarations_cache); + let mut cache; + match opt { + Some(c) => cache = cast::transmute(c), + None => { + cache = cast::transmute(~ApplicableDeclarationsCache::new()); + } + } + local_data::set(applicable_declarations_cache, cache); + cast::transmute(cache) + } + } + + pub fn style_sharing_candidate_cache<'a>(&'a self) -> &'a mut StyleSharingCandidateCache { + unsafe { + let opt = local_data::pop(style_sharing_candidate_cache); + let mut cache; + match opt { + Some(c) => cache = cast::transmute(c), + None => { + cache = cast::transmute(~StyleSharingCandidateCache::new()); + } + } + local_data::set(style_sharing_candidate_cache, cache); + cast::transmute(cache) + } + } +} + diff --git a/src/components/msg/msg.rs b/src/components/msg/msg.rs index 659de719d32..e0823328e53 100644 --- a/src/components/msg/msg.rs +++ b/src/components/msg/msg.rs @@ -4,6 +4,8 @@ #[crate_id = "github.com/mozilla/servo#msg:0.1"]; #[crate_type = "lib"]; +#[crate_type = "dylib"]; +#[crate_type = "rlib"]; #[feature(managed_boxes)]; diff --git a/src/components/net/net.rs b/src/components/net/net.rs index 7f4b340cf84..f23803af0bd 100644 --- a/src/components/net/net.rs +++ b/src/components/net/net.rs @@ -4,6 +4,8 @@ #[crate_id = "github.com/mozilla/servo#net:0.1"]; #[crate_type = "lib"]; +#[crate_type = "dylib"]; +#[crate_type = "rlib"]; #[feature(globs, managed_boxes)]; diff --git a/src/components/script/script.rs b/src/components/script/script.rs index 9ab4c2cc671..3a94e9f9657 100644 --- a/src/components/script/script.rs +++ b/src/components/script/script.rs @@ -4,6 +4,8 @@ #[crate_id = "github.com/mozilla/servo#script:0.1"]; #[crate_type = "lib"]; +#[crate_type = "dylib"]; +#[crate_type = "rlib"]; #[comment = "The Servo Parallel Browser Project"]; #[license = "MPL"]; diff --git a/src/components/style/style.rs b/src/components/style/style.rs index c2659665063..b923b4cfa30 100644 --- a/src/components/style/style.rs +++ b/src/components/style/style.rs @@ -4,6 +4,8 @@ #[crate_id = "github.com/mozilla/servo#style:0.1"]; #[crate_type = "lib"]; +#[crate_type = "dylib"]; +#[crate_type = "rlib"]; #[comment = "The Servo Parallel Browser Project"]; #[license = "MPL"]; diff --git a/src/components/util/util.rs b/src/components/util/util.rs index 78ff97a5e05..27796803913 100644 --- a/src/components/util/util.rs +++ b/src/components/util/util.rs @@ -4,6 +4,8 @@ #[crate_id = "github.com/mozilla/servo#util:0.1"]; #[crate_type = "lib"]; +#[crate_type = "dylib"]; +#[crate_type = "rlib"]; #[feature(macro_rules, managed_boxes)]; diff --git a/src/platform/android/servo-android-glue b/src/platform/android/servo-android-glue index caf03d371cb..5196a2a5824 160000 --- a/src/platform/android/servo-android-glue +++ b/src/platform/android/servo-android-glue @@ -1 +1 @@ -Subproject commit caf03d371cb99c9c72a7127114d8f5365a02eb06 +Subproject commit 5196a2a58249ac5cfb0a24418dc628551883c807 diff --git a/src/support/egl/rust-egl b/src/support/egl/rust-egl index 38cc35371a8..700b07bd663 160000 --- a/src/support/egl/rust-egl +++ b/src/support/egl/rust-egl @@ -1 +1 @@ -Subproject commit 38cc35371a88f6240cd4b35205b2ec8b6703f13a +Subproject commit 700b07bd663c6559326ef7126886e200aa3b0ab1 diff --git a/src/support/glut/rust-glut b/src/support/glut/rust-glut index be49cbc2d54..6050ecb8e88 160000 --- a/src/support/glut/rust-glut +++ b/src/support/glut/rust-glut @@ -1 +1 @@ -Subproject commit be49cbc2d5455744c7951b07160f0d29fed23641 +Subproject commit 6050ecb8e884b4eba1155dacb29d1c9567886c23 diff --git a/src/support/harfbuzz/rust-harfbuzz b/src/support/harfbuzz/rust-harfbuzz index c422c3ca200..9c2a78f3c43 160000 --- a/src/support/harfbuzz/rust-harfbuzz +++ b/src/support/harfbuzz/rust-harfbuzz @@ -1 +1 @@ -Subproject commit c422c3ca200da371d73af2246b62e6d7c40125e2 +Subproject commit 9c2a78f3c43d3b52391b94aa43dc61d6bddab50b diff --git a/src/support/stb-image/rust-stb-image b/src/support/stb-image/rust-stb-image index 064e33d8217..b00422e9636 160000 --- a/src/support/stb-image/rust-stb-image +++ b/src/support/stb-image/rust-stb-image @@ -1 +1 @@ -Subproject commit 064e33d8217424a33636c8019b1f1f74a44ee2bb +Subproject commit b00422e963694f7e46fe551a089b198badea5e1f From aa636218e154a317a19a88858fe71e012573408b Mon Sep 17 00:00:00 2001 From: "aydin.kim" Date: Tue, 8 Apr 2014 15:06:11 +0900 Subject: [PATCH 2/3] fix android for rust update --- Makefile.in | 2 +- src/components/gfx/platform/android/font.rs | 6 +-- .../gfx/platform/android/font_list.rs | 2 +- src/components/main/layout/context.rs | 5 +++ .../main/platform/common/glut_windowing.rs | 44 +++++++++---------- src/components/main/servo.rs | 3 +- src/platform/android/servo-android-glue | 2 +- src/support/egl/rust-egl | 2 +- src/support/layers/rust-layers | 2 +- src/support/stb-image/rust-stb-image | 2 +- 10 files changed, 37 insertions(+), 33 deletions(-) diff --git a/Makefile.in b/Makefile.in index e47d942b165..d8619e8bd8b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -30,7 +30,7 @@ B := $(CFG_BUILD_DIR) MKFILE_DEPS := config.stamp $(call rwildcard,$(S)mk/,*) CFG_GCCISH_CFLAGS += -DRUST_DEBUG -CFG_RUSTC_FLAGS = -D unused-imports +CFG_RUSTC_FLAGS += -D unused-imports ifdef CFG_DISABLE_OPTIMIZE $(info cfg: disabling rustc optimization (CFG_DISABLE_OPTIMIZE)) diff --git a/src/components/gfx/platform/android/font.rs b/src/components/gfx/platform/android/font.rs index 46205f57ffb..ad6228c7533 100644 --- a/src/components/gfx/platform/android/font.rs +++ b/src/components/gfx/platform/android/font.rs @@ -76,7 +76,7 @@ impl FontHandleMethods for FontHandle { buf: ~[u8], style: &SpecifiedFontStyle) -> Result { - let ft_ctx: FT_Library = fctx.ctx.borrow().ctx; + let ft_ctx: FT_Library = fctx.ctx.ctx; if ft_ctx.is_null() { return Err(()); } let face_result = create_face_from_buffer(ft_ctx, buf.as_ptr(), buf.len(), style.pt_size); @@ -279,7 +279,7 @@ impl<'a> FontHandle { pub fn new_from_file(fctx: &FontContextHandle, file: &str, style: &SpecifiedFontStyle) -> Result { unsafe { - let ft_ctx: FT_Library = fctx.ctx.borrow().ctx; + let ft_ctx: FT_Library = fctx.ctx.ctx; if ft_ctx.is_null() { return Err(()); } let mut face: FT_Face = ptr::null(); @@ -306,7 +306,7 @@ impl<'a> FontHandle { pub fn new_from_file_unstyled(fctx: &FontContextHandle, file: ~str) -> Result { unsafe { - let ft_ctx: FT_Library = fctx.ctx.borrow().ctx; + let ft_ctx: FT_Library = fctx.ctx.ctx; if ft_ctx.is_null() { return Err(()); } let mut face: FT_Face = ptr::null(); diff --git a/src/components/gfx/platform/android/font_list.rs b/src/components/gfx/platform/android/font_list.rs index e372d891797..b245b74e4bd 100644 --- a/src/components/gfx/platform/android/font_list.rs +++ b/src/components/gfx/platform/android/font_list.rs @@ -25,7 +25,7 @@ use font_list::{FontEntry, FontFamily, FontFamilyMap}; use platform::font::FontHandle; use platform::font_context::FontContextHandle; -use collections::hashmap::HashMap; +use collections::HashMap; use std::libc; use std::libc::{c_int, c_char}; use std::ptr; diff --git a/src/components/main/layout/context.rs b/src/components/main/layout/context.rs index 041f6747abd..a43fff40119 100644 --- a/src/components/main/layout/context.rs +++ b/src/components/main/layout/context.rs @@ -9,6 +9,7 @@ use css::matching::{ApplicableDeclarationsCache, StyleSharingCandidateCache}; use geom::size::Size2D; use gfx::display_list::OpaqueNode; use gfx::font_context::{FontContext, FontContextInfo}; +#[cfg(not(target_os="android"))] use green::task::GreenTask; use script::layout_interface::LayoutChan; use servo_msg::constellation_msg::ConstellationChan; @@ -16,9 +17,13 @@ use servo_net::local_image_cache::LocalImageCache; use servo_util::geometry::Au; use servo_util::opts::Opts; use std::cast; +#[cfg(not(target_os="android"))] use std::ptr; +#[cfg(not(target_os="android"))] use std::rt::Runtime; +#[cfg(not(target_os="android"))] use std::rt::local::Local; +#[cfg(not(target_os="android"))] use std::rt::task::Task; use style::{ComputedValues, Stylist}; use sync::{Arc, MutexArc}; diff --git a/src/components/main/platform/common/glut_windowing.rs b/src/components/main/platform/common/glut_windowing.rs index 2d59539a8d1..23d6ab2d4f6 100644 --- a/src/components/main/platform/common/glut_windowing.rs +++ b/src/components/main/platform/common/glut_windowing.rs @@ -97,7 +97,7 @@ impl WindowMethods for Window { impl glut::ReshapeCallback for ReshapeCallbackState { fn call(&self, width: c_int, height: c_int) { let tmp = local_window(); - tmp.borrow().event_queue.with_mut(|queue| queue.push(ResizeWindowEvent(width as uint, height as uint))) + tmp.event_queue.borrow_mut().push(ResizeWindowEvent(width as uint, height as uint)) } } glut::reshape_func(glut_window, ~ReshapeCallbackState); @@ -105,7 +105,7 @@ impl WindowMethods for Window { impl glut::KeyboardCallback for KeyboardCallbackState { fn call(&self, key: c_uchar, _x: c_int, _y: c_int) { let tmp = local_window(); - tmp.borrow().handle_key(key) + tmp.handle_key(key) } } glut::keyboard_func(~KeyboardCallbackState); @@ -114,16 +114,16 @@ impl WindowMethods for Window { fn call(&self, button: c_int, state: c_int, x: c_int, y: c_int) { if button < 3 { let tmp = local_window(); - tmp.borrow().handle_mouse(button, state, x, y); + tmp.handle_mouse(button, state, x, y); } else { match button { 3 => { let tmp = local_window(); - tmp.borrow().event_queue.with_mut(|queue| queue.push(ScrollWindowEvent(Point2D(0.0, 5.0 as f32), Point2D(0.0 as i32, 5.0 as i32)))); + tmp.event_queue.borrow_mut().push(ScrollWindowEvent(Point2D(0.0, 5.0 as f32), Point2D(0.0 as i32, 5.0 as i32))); }, 4 => { let tmp = local_window(); - tmp.borrow().event_queue.with_mut(|queue| queue.push(ScrollWindowEvent(Point2D(0.0, -5.0 as f32), Point2D(0.0 as i32, -5.0 as i32)))); + tmp.event_queue.borrow_mut().push(ScrollWindowEvent(Point2D(0.0, -5.0 as f32), Point2D(0.0 as i32, -5.0 as i32))); }, _ => {} } @@ -150,15 +150,13 @@ impl WindowMethods for Window { } fn recv(&self) -> WindowEvent { - if !self.event_queue.with_mut(|queue| queue.is_empty()) { - return self.event_queue.with_mut(|queue| queue.shift().unwrap()) + if !self.event_queue.borrow_mut().is_empty() { + return self.event_queue.borrow_mut().shift().unwrap(); } + glut::check_loop(); - if !self.event_queue.with_mut(|queue| queue.is_empty()) { - self.event_queue.with_mut(|queue| queue.shift().unwrap()) - } else { - IdleWindowEvent - } + + self.event_queue.borrow_mut().shift().unwrap_or(IdleWindowEvent) } /// Sets the ready state. @@ -174,7 +172,7 @@ impl WindowMethods for Window { self.render_state.get() == RenderingRenderState && render_state == IdleRenderState { // page loaded - self.event_queue.with_mut(|queue| queue.push(FinishedWindowEvent)); + self.event_queue.borrow_mut().push(FinishedWindowEvent); } self.render_state.set(render_state); @@ -219,16 +217,16 @@ impl Window { let modifiers = glut::get_modifiers(); match key { 42 => self.load_url(), - 43 => self.event_queue.with_mut(|queue| queue.push(ZoomWindowEvent(1.1))), - 45 => self.event_queue.with_mut(|queue| queue.push(ZoomWindowEvent(0.909090909))), - 56 => self.event_queue.with_mut(|queue| queue.push(ScrollWindowEvent(Point2D(0.0, 5.0 as f32), Point2D(0.0 as i32, 5.0 as i32)))), - 50 => self.event_queue.with_mut(|queue| queue.push(ScrollWindowEvent(Point2D(0.0, -5.0 as f32), Point2D(0.0 as i32, -5.0 as i32)))), + 43 => self.event_queue.borrow_mut().push(ZoomWindowEvent(1.1)), + 45 => self.event_queue.borrow_mut().push(ZoomWindowEvent(0.909090909)), + 56 => self.event_queue.borrow_mut().push(ScrollWindowEvent(Point2D(0.0, 5.0 as f32), Point2D(0.0 as i32, 5.0 as i32))), + 50 => self.event_queue.borrow_mut().push(ScrollWindowEvent(Point2D(0.0, -5.0 as f32), Point2D(0.0 as i32, -5.0 as i32))), 127 => { if (modifiers & ACTIVE_SHIFT) != 0 { - self.event_queue.with_mut(|queue| queue.push(NavigationWindowEvent(Forward))); + self.event_queue.borrow_mut().push(NavigationWindowEvent(Forward)); } else { - self.event_queue.with_mut(|queue| queue.push(NavigationWindowEvent(Back))); + self.event_queue.borrow_mut().push(NavigationWindowEvent(Back)); } } _ => {} @@ -253,14 +251,14 @@ impl Window { if pixel_dist < max_pixel_dist { let click_event = MouseWindowClickEvent(button as uint, Point2D(x as f32, y as f32)); - self.event_queue.with_mut(|queue| queue.push(MouseWindowEventClass(click_event))); + self.event_queue.borrow_mut().push(MouseWindowEventClass(click_event)); } } MouseWindowMouseUpEvent(button as uint, Point2D(x as f32, y as f32)) } _ => fail!("I cannot recognize the type of mouse action that occured. :-(") }; - self.event_queue.with_mut(|queue| queue.push(MouseWindowEventClass(event))); + self.event_queue.borrow_mut().push(MouseWindowEventClass(event)); } /// Helper function to pop up an alert box prompting the user to load a URL. @@ -270,9 +268,9 @@ impl Window { alert.run(); let value = alert.prompt_value(); if "" == value { // To avoid crashing on Linux. - self.event_queue.with_mut(|queue| queue.push(LoadUrlWindowEvent(~"http://purple.com/"))) + self.event_queue.borrow_mut().push(LoadUrlWindowEvent(~"http://purple.com/")) } else { - self.event_queue.with_mut(|queue| queue.push(LoadUrlWindowEvent(value.clone()))) + self.event_queue.borrow_mut().push(LoadUrlWindowEvent(value.clone())) } } } diff --git a/src/components/main/servo.rs b/src/components/main/servo.rs index 225922f01d6..c52ae877f6c 100755 --- a/src/components/main/servo.rs +++ b/src/components/main/servo.rs @@ -67,7 +67,8 @@ use servo_util::opts; #[cfg(not(test))] use servo_util::url::parse_url; -#[cfg(not(test))] +#[cfg(not(test), target_os="linux")] +#[cfg(not(test), target_os="macos")] use std::os; #[cfg(not(test), target_os="android")] use std::str; diff --git a/src/platform/android/servo-android-glue b/src/platform/android/servo-android-glue index 5196a2a5824..89757a91ba1 160000 --- a/src/platform/android/servo-android-glue +++ b/src/platform/android/servo-android-glue @@ -1 +1 @@ -Subproject commit 5196a2a58249ac5cfb0a24418dc628551883c807 +Subproject commit 89757a91ba1b012cb003ceb60a121226f5646c02 diff --git a/src/support/egl/rust-egl b/src/support/egl/rust-egl index 700b07bd663..c2b23d8aa8d 160000 --- a/src/support/egl/rust-egl +++ b/src/support/egl/rust-egl @@ -1 +1 @@ -Subproject commit 700b07bd663c6559326ef7126886e200aa3b0ab1 +Subproject commit c2b23d8aa8dc857536b1b68cf6646a1e11517161 diff --git a/src/support/layers/rust-layers b/src/support/layers/rust-layers index 493a4311f12..42f6584fff2 160000 --- a/src/support/layers/rust-layers +++ b/src/support/layers/rust-layers @@ -1 +1 @@ -Subproject commit 493a4311f1202907208aecdaf3fc4a4c192608eb +Subproject commit 42f6584fff271939f9eb7af031710ff4b65df464 diff --git a/src/support/stb-image/rust-stb-image b/src/support/stb-image/rust-stb-image index b00422e9636..a2671a7aec3 160000 --- a/src/support/stb-image/rust-stb-image +++ b/src/support/stb-image/rust-stb-image @@ -1 +1 @@ -Subproject commit b00422e963694f7e46fe551a089b198badea5e1f +Subproject commit a2671a7aec350a85f5de5b4838cbc500ecb03720 From 00e5f010d4f533b5cf1189ed7937c04aaf3cf02d Mon Sep 17 00:00:00 2001 From: Lars Bergstrom Date: Tue, 8 Apr 2014 18:58:29 -0500 Subject: [PATCH 3/3] Update the configuration files to properly build rust. Revert rust-stb-image submodule misupdate. --- Makefile.in | 6 ++++++ configure | 1 - src/compiler/rust | 2 +- src/components/main/layout/context.rs | 6 +++--- src/components/main/servo.rs | 4 ++-- src/platform/android/servo-android-glue | 2 +- src/support/egl/rust-egl | 2 +- src/support/layers/rust-layers | 2 +- src/support/stb-image/rust-stb-image | 2 +- 9 files changed, 16 insertions(+), 11 deletions(-) diff --git a/Makefile.in b/Makefile.in index d8619e8bd8b..21b5e1d15c1 100644 --- a/Makefile.in +++ b/Makefile.in @@ -107,6 +107,12 @@ $(B)src/compiler/rust/rust-auto-clean-stamp: $(S)src/compiler/rust-auto-clean-tr rust: $(CFG_RUSTC) +# These arguments are automatically provided by the Rust compiler's build process to +# itself, so they must be specified later for our Rust modules. +ifeq ($(CFG_OSTYPE),linux-androideabi) + CFG_RUSTC_FLAGS += --target arm-linux-androideabi -C android-cross-path=$(CFG_ANDROID_CROSS_PATH) +endif + # Strip off submodule paths to determine "raw" submodule names. SUBMODULES=$(shell echo $(CFG_SUBMODULES) | perl -p -e 's![A-Za-z0-9_-]+/!!g') diff --git a/configure b/configure index ad101f6201f..a460952b47a 100755 --- a/configure +++ b/configure @@ -385,7 +385,6 @@ case ${TARGET_OSTYPE} in probe CFG_RANLIB arm-linux-androideabi-ranlib export PATH=${OLD_PATH} - CFG_RUSTC_FLAGS="--target=${CFG_TARGET_TRIPLES} -C android-cross-path=${CFG_ANDROID_CROSS_PATH}" ;; *) CFG_PATH=$PATH diff --git a/src/compiler/rust b/src/compiler/rust index d6811bc1bde..aa39d755e3f 160000 --- a/src/compiler/rust +++ b/src/compiler/rust @@ -1 +1 @@ -Subproject commit d6811bc1bdeb66381af4b9bf3e4ff77b3cee27f6 +Subproject commit aa39d755e3f9823b51cc57761c0c8c75759aca2e diff --git a/src/components/main/layout/context.rs b/src/components/main/layout/context.rs index a43fff40119..512e71aca7a 100644 --- a/src/components/main/layout/context.rs +++ b/src/components/main/layout/context.rs @@ -37,7 +37,7 @@ use std::local_data; static mut FONT_CONTEXT: *mut FontContext = 0 as *mut FontContext; #[cfg(target_os="android")] -local_data_key!(font_context: * mut FontContext) +local_data_key!(font_context: *mut FontContext) #[cfg(not(target_os="android"))] #[thread_local] @@ -45,7 +45,7 @@ static mut APPLICABLE_DECLARATIONS_CACHE: *mut ApplicableDeclarationsCache = 0 as *mut ApplicableDeclarationsCache; #[cfg(target_os="android")] -local_data_key!(applicable_declarations_cache: * mut ApplicableDeclarationsCache) +local_data_key!(applicable_declarations_cache: *mut ApplicableDeclarationsCache) #[cfg(not(target_os="android"))] #[thread_local] @@ -53,7 +53,7 @@ static mut STYLE_SHARING_CANDIDATE_CACHE: *mut StyleSharingCandidateCache = 0 as *mut StyleSharingCandidateCache; #[cfg(target_os="android")] -local_data_key!(style_sharing_candidate_cache: * mut StyleSharingCandidateCache) +local_data_key!(style_sharing_candidate_cache: *mut StyleSharingCandidateCache) /// Data shared by all layout workers. #[deriving(Clone)] diff --git a/src/components/main/servo.rs b/src/components/main/servo.rs index c52ae877f6c..562cd71ce28 100755 --- a/src/components/main/servo.rs +++ b/src/components/main/servo.rs @@ -67,8 +67,8 @@ use servo_util::opts; #[cfg(not(test))] use servo_util::url::parse_url; -#[cfg(not(test), target_os="linux")] -#[cfg(not(test), target_os="macos")] + +#[cfg(not(test), not(target_os="android"))] use std::os; #[cfg(not(test), target_os="android")] use std::str; diff --git a/src/platform/android/servo-android-glue b/src/platform/android/servo-android-glue index 89757a91ba1..0941b770238 160000 --- a/src/platform/android/servo-android-glue +++ b/src/platform/android/servo-android-glue @@ -1 +1 @@ -Subproject commit 89757a91ba1b012cb003ceb60a121226f5646c02 +Subproject commit 0941b7702380d57ffe95823cfb057d752fd150ae diff --git a/src/support/egl/rust-egl b/src/support/egl/rust-egl index c2b23d8aa8d..ffb1be4fecb 160000 --- a/src/support/egl/rust-egl +++ b/src/support/egl/rust-egl @@ -1 +1 @@ -Subproject commit c2b23d8aa8dc857536b1b68cf6646a1e11517161 +Subproject commit ffb1be4fecbfadacd02e5a714025bc58e6833f27 diff --git a/src/support/layers/rust-layers b/src/support/layers/rust-layers index 42f6584fff2..10d40153462 160000 --- a/src/support/layers/rust-layers +++ b/src/support/layers/rust-layers @@ -1 +1 @@ -Subproject commit 42f6584fff271939f9eb7af031710ff4b65df464 +Subproject commit 10d40153462cf7248fcf35db5c18cf026cd25aea diff --git a/src/support/stb-image/rust-stb-image b/src/support/stb-image/rust-stb-image index a2671a7aec3..064e33d8217 160000 --- a/src/support/stb-image/rust-stb-image +++ b/src/support/stb-image/rust-stb-image @@ -1 +1 @@ -Subproject commit a2671a7aec350a85f5de5b4838cbc500ecb03720 +Subproject commit 064e33d8217424a33636c8019b1f1f74a44ee2bb