Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

FreeBSD support: gclient sync fails on "gyp: Undefined variable yasm_path in ....libjpeg.gyp" #1007

Closed
GoogleCodeExporter opened this issue Apr 6, 2015 · 78 comments

Comments

@GoogleCodeExporter
Copy link

Trying to follow the instructions here: 
https://github.com/pagespeed/ngx_pagespeed/wiki/Building-PSOL-From-Source



________ running 'svn update /usr/home/user/mod_pagespeed/src/tools/gyp 
--revision 1860 --force --accept theirs-conflict --ignore-externals' in 
'/usr/home/user/mod_pagespeed'
Updating 'src/tools/gyp':
At revision 1860.
Syncing projects: 100% (43/43), done.

________ running '/usr/local/bin/python src/tools/clang/scripts/update.py 
--mac-only' in '/usr/home/user/mod_pagespeed'

________ running '/usr/local/bin/python src/build/gyp_chromium 
-Dchromium_revision=256281' in '/usr/home/user/mod_pagespeed'
Updating projects from gyp files...
gyp: Undefined variable yasm_path in 
/usr/home/user/mod_pagespeed/src/third_party/libjpeg_turbo/src/libjpeg.gyp
Error: Command /usr/local/bin/python src/build/gyp_chromium 
-Dchromium_revision=256281 returned non-zero exit status 1 in 
/usr/home/user/mod_pagespeed

I'm guessing the code doesn't consider FreeBSD when choosing how to 
install/build/use yasm

Original issue reported on code.google.com by miguelmc...@gmail.com on 23 Oct 2014 at 12:12

@GoogleCodeExporter
Copy link
Author


--- src/third_party/libjpeg_turbo/src/libjpeg.gyp.orig  2014-10-23 
01:21:43.575211138 +0100
+++ src/third_party/libjpeg_turbo/src/libjpeg.gyp       2014-10-23 
01:19:06.858223239 +0100
@@ -241,5 +241,5 @@
           },
         }],
-        [ 'OS=="linux" or (OS=="android" and target_arch!="arm")', {
+        [ 'OS=="linux" or (OS=="android" and target_arch!="arm") or 
OS=="freebsd"', {
           'conditions': [
             [ 'use_system_yasm==0', {


As I thought... that did It and glient finished fine! not sure if its the best 
place to do it but it does seem so!

Original comment by miguelmc...@gmail.com on 23 Oct 2014 at 12:23

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

gmake AR.host="$PWD/build/wrappers/ar.sh" \                                     
           AR.target="$PWD/build/wrappers/ar.sh" \                              
                 BUILDTYPE=Release \                                            
                       mod_pagespeed_test pagespeed_automatic_test 

complains about libstdc but I'm not sure how to get around tha :|

out/Release/obj/gen/protoc_out/instaweb/net/instaweb/rewriter/image_types.pb.h
/usr/local/lib/compat/libstdc++.so.6: version GLIBCXX_3.4.11 required by 
/usr/home/miguelc/mod_pagespeed/src/out/Release/protoc not found
gmake: *** 
[out/Release/obj/gen/protoc_out/instaweb/net/instaweb/rewriter/image_types.pb.h]
 Error 1

"/usr/local/lib/compat/libstdc++.so.6" doesn't exist in FreeBSD10 but it can be 
installed by compat9x, and it is installed 

 ls /usr/local/lib/compat/libstdc++.so.6 
/usr/local/lib/compat/libstdc++.so.6


But this still shows the error |:

Original comment by miguelmc...@gmail.com on 23 Oct 2014 at 1:58

@GoogleCodeExporter
Copy link
Author

Update: remove compat9x seems to workarround this but:

  LINK(host) out/Release/protoc
  RULE _usr_home_miguelc_mod_pagespeed_src_net_instaweb_instaweb_gyp_instaweb_image_types_pb_target_genproto_0 out/Release/obj/gen/protoc_out/instaweb/net/instaweb/rewriter/image_types.pb.h
  CXX(target) out/Release/obj.target/instaweb_image_types_pb/gen/protoc_out/instaweb/net/instaweb/rewriter/image_types.pb.o
error: unknown warning option '-Wno-unused-local-typedefs'
      [-Werror,-Wunknown-warning-option]
gmake: *** 
[out/Release/obj.target/instaweb_image_types_pb/gen/protoc_out/instaweb/net/inst
aweb/rewriter/image_types.pb.o] Error 1

Original comment by miguelmc...@gmail.com on 23 Oct 2014 at 2:06

@GoogleCodeExporter
Copy link
Author

For that one you probably want something similar to this:
https://code.google.com/p/modpagespeed/source/browse/trunk/src/build/common.gypi
#83

What compiler is this, anyway?


Original comment by morlov...@google.com on 23 Oct 2014 at 2:01

@GoogleCodeExporter
Copy link
Author

You mean what compiler I'm using? 

g++ 

(More info: ) g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc48/gcc/x86_64-portbld-freebsd10.1/4.8.
3/lto-wrapper
Target: x86_64-portbld-freebsd10.1
Configured with: ./../gcc-4.8.3/configure --disable-bootstrap --disable-nls 
--enable-gnu-indirect-function --libdir=/usr/local/lib/gcc48 
--libexecdir=/usr/local/libexec/gcc48 --program-suffix=48 
--with-as=/usr/local/bin/as --with-gmp=/usr/local 
--with-gxx-include-dir=/usr/local/lib/gcc48/include/c++/ 
--with-ld=/usr/local/bin/ld --with-pkgversion='FreeBSD Ports Collection' 
--with-system-zlib --with-ecj-jar=/usr/local/share/java/ecj-4.5.jar 
--enable-languages=c,c++,objc,fortran,java --prefix=/usr/local 
--mandir=/usr/local/man --infodir=/usr/local/info/gcc48 
--build=x86_64-portbld-freebsd10.1
Thread model: posix
gcc version 4.8.3 (FreeBSD Ports Collection) 

I'm also using "gamke" instead of freebsd's make which wouldn't work of course!

Original comment by miguelmc...@gmail.com on 23 Oct 2014 at 2:32

@GoogleCodeExporter
Copy link
Author

Huh, that's supposed to be supported by that. Could you try running
make V=1? That will print command lines --- maybe clang is getting
used or something?

Original comment by morlov...@google.com on 23 Oct 2014 at 2:46

@GoogleCodeExporter
Copy link
Author

Do you mean gmake? I'm posting both anyway

make V=1
make: "/usr/home/miguelc/mod_pagespeed/src/Makefile" line 17: Need an operator
make: "/usr/home/miguelc/mod_pagespeed/src/Makefile" line 19: Need an operator
make: "/usr/home/miguelc/mod_pagespeed/src/Makefile" line 21: Need an operator
make: "/usr/home/miguelc/mod_pagespeed/src/Makefile" line 111: Need an operator
make: "/usr/home/miguelc/mod_pagespeed/src/Makefile" line 113: Need an operator
make: "/usr/home/miguelc/mod_pagespeed/src/Makefile" line 115: Need an operator
make: "/usr/home/miguelc/mod_pagespeed/src/Makefile" line 124: Need an operator
make: "/usr/home/miguelc/mod_pagespeed/src/Makefile" line 125: Need an operator
make: "/usr/home/miguelc/mod_pagespeed/src/Makefile" line 216: Need an operator
.......


 gmake V=1                                                                                                                            
  LD_LIBRARY_PATH=/usr/home/miguelc/mod_pagespeed/src/out/Debug/lib.host:/usr/home/miguelc/mod_pagespeed/src/out/Debug/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd base; mkdir -p ../third_party/chromium/src/base; bash -c "sed 's/\"xgetbv\"/\".byte 0x0f, 0x01, 0xd0\"/' ../third_party/chromium/src/base/cpu.cc > ../third_party/chromium/src/base/cpu_patched.cc"
  touch out/Debug/obj.target/base/cpu_patched.stamp
  c++ '-DCHROMIUM_REVISION=256281' '-DV8_DEPRECATION_WARNINGS' '-DBLINK_SCALE_FILTERS_AT_RECORD_TIME' '-D_FILE_OFFSET_BITS=64' '-DCHROMIUM_BUILD' '-DUSE_CAIRO=1' '-DUSE_GLIB=1' '-DUSE_DEFAULT_RENDER_THEME=1' '-DUSE_LIBJPEG_TURBO=1' '-DUSE_NSS=1' '-DUSE_X11=1' '-DGTK_DISABLE_SINGLE_INCLUDES=1' '-DUSE_XI2_MT=2' '-DENABLE_REMOTING=1' '-DENABLE_WEBRTC=1' '-DENABLE_CONFIGURATION_POLICY' '-DENABLE_INPUT_SPEECH' '-DENABLE_NOTIFICATIONS' '-DENABLE_NEW_GAMEPAD_API=1' '-DENABLE_EGLIMAGE=1' '-DENABLE_TASK_MANAGER=1' '-DENABLE_EXTENSIONS=1' '-DENABLE_PLUGIN_INSTALLATION=1' '-DENABLE_PLUGINS=1' '-DENABLE_SESSION_SERVICE=1' '-DENABLE_THEMES=1' '-DENABLE_BACKGROUND=1' '-DENABLE_AUTOMATION=1' '-DENABLE_GOOGLE_NOW=1' '-DCLD_VERSION=2' '-DENABLE_FULL_PRINTING=1' '-DENABLE_PRINTING=1' '-DENABLE_SPELLCHECK=1' '-DENABLE_CAPTIVE_PORTAL_DETECTION=1' '-DENABLE_MANAGED_USERS=1' '-D__STDC_CONSTANT_MACROS' '-D__STDC_FORMAT_MACROS' '-DDYNAMIC_ANNOTATIONS_ENABLED=1' '-DWTF_USE_DYNAMIC_ANNOTATIONS=1' '-D_DEBUG' -Ithird_party/chromium/src -I.  -fstack-protector --param=ssp-buffer-size=4 -Werror -pthread -fno-exceptions -fno-strict-aliasing -Wall -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -Wno-unused-local-typedefs -O0 -g -funwind-tables -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -Wsign-compare -MMD -MF out/Debug/.deps/out/Debug/obj.target/base/third_party/chromium/src/base/base64.o.d.raw  -c -o out/Debug/obj.target/base/third_party/chromium/src/base/base64.o third_party/chromium/src/base/base64.cc
error: unknown warning option '-Wno-unused-local-typedefs' 
[-Werror,-Wunknown-warning-option]
gmake: *** [out/Debug/obj.target/base/third_party/chromium/src/base/base64.o] 
Error 1

Original comment by miguelmc...@gmail.com on 23 Oct 2014 at 2:49

@GoogleCodeExporter
Copy link
Author

Right, of course, gmake, sorry. Is "c++" also gcc? If not the quickest option 
may be to set CXX to g++. (The proper fix is of course to fix the flags logic 
to use proper flags for clang, but that's likely to be irritatingly fiddly).

Original comment by morlov...@google.com on 23 Oct 2014 at 2:56

@GoogleCodeExporter
Copy link
Author

Ah nope c++ is clang now :P

Cleaning and going with:

gmake AR.host="$PWD/build/wrappers/ar.sh" \
        AR.target="$PWD/build/wrappers/ar.sh" \
        BUILDTYPE=Release \
        CXX.target=g++ \
        mod_pagespeed_test pagespeed_automatic_test 


Original comment by miguelmc...@gmail.com on 23 Oct 2014 at 3:12

@GoogleCodeExporter
Copy link
Author

Well I got past it for sure, but libstdc is going to be another issue:

  CXX(host) out/Release/obj.host/protoc/third_party/protobuf/src/google/protobuf/compiler/java/java_primitive_field.o
  CXX(host) out/Release/obj.host/protoc/third_party/protobuf/src/google/protobuf/compiler/java/java_service.o
  CXX(host) out/Release/obj.host/protoc/third_party/protobuf/src/google/protobuf/compiler/java/java_string_field.o
  CXX(host) out/Release/obj.host/protoc/third_party/protobuf/src/google/protobuf/compiler/python/python_generator.o
  CXX(host) out/Release/obj.host/protoc/third_party/protobuf/src/google/protobuf/compiler/main.o
  LINK(host) out/Release/protoc
  RULE _usr_home_miguelc_mod_pagespeed_src_net_instaweb_instaweb_gyp_instaweb_image_types_pb_target_genproto_0 out/Release/obj/gen/protoc_out/instaweb/net/instaweb/rewriter/image_types.pb.h
/usr/local/lib/compat/libstdc++.so.6: version GLIBCXX_3.4.11 required by 
/usr/home/miguelc/mod_pagespeed/src/out/Release/protoc not found
gmake: *** 
[out/Release/obj/gen/protoc_out/instaweb/net/instaweb/rewriter/image_types.pb.h]
 Error 1

I have compat9x installed so /usr/local/lib/compat/libstdc++.so.6 is probably 
outdated...

Yeah:
strings /usr/local/lib/compat/libstdc++.so.6 |grep GLIBCXX
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_FORCE_NEW


Original comment by miguelmc...@gmail.com on 23 Oct 2014 at 3:16

@GoogleCodeExporter
Copy link
Author

(I have compat9x installed so /usr/local/lib/compat/libstdc++.so.6 is probably 
outdated...)

I should add that FreeBSD10 doesn't have libstdc++

Original comment by miguelmc...@gmail.com on 23 Oct 2014 at 3:17

@GoogleCodeExporter
Copy link
Author

Hum I see in the code there's a workaround for solaris... wonder how complex 
would be to apply it to freebsd!

Original comment by miguelmc...@gmail.com on 23 Oct 2014 at 3:24

@GoogleCodeExporter
Copy link
Author

To workaround it I deleted compat9x, and this way it seems to use its own 
libstdc!


New issue though:

  CXX(target) out/Release/obj.target/instaweb_util/net/instaweb/http/wget_url_fetcher.o
  CXX(target) out/Release/obj.target/instaweb_util/net/instaweb/http/write_through_http_cache.o
  CXX(target) out/Release/obj.target/instaweb_util/net/instaweb/util/abstract_property_store_get_callback.o
  CXX(target) out/Release/obj.target/instaweb_util/net/instaweb/util/cache_property_store.o
  CXX(target) out/Release/obj.target/instaweb_util/net/instaweb/util/fallback_property_page.o
  CXX(target) out/Release/obj.target/instaweb_util/net/instaweb/util/mock_property_page.o
  CXX(target) out/Release/obj.target/instaweb_util/net/instaweb/util/property_cache.o
  CXX(target) out/Release/obj.target/instaweb_util/net/instaweb/util/property_store.o
  CXX(target) out/Release/obj.target/instaweb_util/net/instaweb/util/two_level_property_store.o
  AR(target) out/Release/obj.target/net/instaweb/libinstaweb_util.a
  CXX(target) out/Release/obj.target/gflags/third_party/gflags/src/gflags.o
third_party/gflags/src/gflags.cc:91:20: fatal error: config.h: No such file or 
directory
 #include "config.h"
                    ^
compilation terminated.

config.h is indeed missing

Original comment by miguelmc...@gmail.com on 23 Oct 2014 at 3:55

@GoogleCodeExporter
Copy link
Author

Yeah, libstdc++ should come with g++ (I don't think libc++ is usable with g++, 
but I may be wrong). As for config.h thing, you probably need to copy/symlink
third_party/gflags/gen/arch/linux over to third_party/gflags/gen/arch/freebsd 
or some such --- one of the -I arguments to g++ should say exactly what.



Original comment by morlov...@google.com on 23 Oct 2014 at 4:25

@GoogleCodeExporter
Copy link
Author

libc++ is usable with clang but I'm not sure about g++ either...

the symlinks works indeed, thanks for pointing that out!

New issue :P
$ gmake V=1 AR.host="$PWD/build/wrappers/ar.sh" \                               
     AR.target="$PWD/build/wrappers/ar.sh" \                                    
   BUILDTYPE=Release \                                                          
 CXX.target=g++ \                                                              
mod_pagespeed_test pagespeed_automatic_test
  g++ '-DCHROMIUM_REVISION=256281' '-DV8_DEPRECATION_WARNINGS' '-DBLINK_SCALE_FILTERS_AT_RECORD_TIME' '-D_FILE_OFFSET_BITS=64' '-DCHROMIUM_BUILD' '-DUSE_CAIRO=1' '-DUSE_GLIB=1' '-DUSE_DEFAULT_RENDER_THEME=1' '-DUSE_LIBJPEG_TURBO=1' '-DUSE_NSS=1' '-DUSE_X11=1' '-DGTK_DISABLE_SINGLE_INCLUDES=1' '-DUSE_XI2_MT=2' '-DENABLE_REMOTING=1' '-DENABLE_WEBRTC=1' '-DENABLE_CONFIGURATION_POLICY' '-DENABLE_INPUT_SPEECH' '-DENABLE_NOTIFICATIONS' '-DENABLE_NEW_GAMEPAD_API=1' '-DENABLE_EGLIMAGE=1' '-DENABLE_TASK_MANAGER=1' '-DENABLE_EXTENSIONS=1' '-DENABLE_PLUGIN_INSTALLATION=1' '-DENABLE_PLUGINS=1' '-DENABLE_SESSION_SERVICE=1' '-DENABLE_THEMES=1' '-DENABLE_BACKGROUND=1' '-DENABLE_AUTOMATION=1' '-DENABLE_GOOGLE_NOW=1' '-DCLD_VERSION=2' '-DENABLE_FULL_PRINTING=1' '-DENABLE_PRINTING=1' '-DENABLE_SPELLCHECK=1' '-DENABLE_CAPTIVE_PORTAL_DETECTION=1' '-DENABLE_MANAGED_USERS=1' '-D__STDC_CONSTANT_MACROS' '-D__STDC_FORMAT_MACROS' '-DNDEBUG' '-DNVALGRIND' '-DDYNAMIC_ANNOTATIONS_ENABLED=0' '-D_FORTIFY_SOURCE=2' -Ithird_party/chromium/src -I.  -fstack-protector --param=ssp-buffer-size=4 -Werror -pthread -fno-exceptions -fno-strict-aliasing -Wall -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -Wno-unused-local-typedefs -O2 -fno-ident -fdata-sections -ffunction-sections -funwind-tables -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -Wsign-compare -MMD -MF out/Release/.deps/out/Release/obj.target/base/third_party/chromium/src/base/threading/platform_thread_linux.o.d.raw  -c -o out/Release/obj.target/base/third_party/chromium/src/base/threading/platform_thread_linux.o third_party/chromium/src/base/threading/platform_thread_linux.cc
third_party/chromium/src/base/threading/platform_thread_linux.cc:19:23: fatal 
error: sys/prctl.h: No such file or directory
 #include <sys/prctl.h>
                       ^
compilation terminated.
gmake: *** 
[out/Release/obj.target/base/third_party/chromium/src/base/threading/platform_th
read_linux.o] Error 

This one I really have no clue... does it make sense to build 
"platform_thread_linux.o" on freebsd?

Original comment by miguelmc...@gmail.com on 23 Oct 2014 at 6:36

@GoogleCodeExporter
Copy link
Author

https://code.google.com/p/v8/issues/detail?id=2010

This offers some interesting info... however it seems to be patched and indeed 

"  if sys.platform.startswith('freebsd'):
    return 'freebsd'" is present in the local "tools/gyp/pylib/gyp/common.py" version

I'm guessing here... but maybe its related to 
"third_party/gflags/gen/arch/linux" I should copy instead of symlink and 
probably some defines need to be changed!
Sorry if this makes no sense :P


Original comment by miguelmc...@gmail.com on 23 Oct 2014 at 7:03

@GoogleCodeExporter
Copy link
Author

Hum...

http://modpagespeed.googlecode.com/svn/branches/latest-beta/src/base/base.gypi

This seems to include platform_thread_linux ... even in freebsd if I'm correct?

Also:
third_party/chromium/src/base/threading/platform_thread_freebsd.cc exists... so 
it should use that in freebsd... 

The problem is I'm not sure how to patch this... I'm not familiar with gypi... 
all I can tell is that is similar to JSON but just y reading some files I see 
some stuff JSON doens't support at all :P

I'll see If I can get something working... but would really appreciate if 
someone more experienced could patch it (assuming this is the root of the issue 
ofc)

Original comment by miguelmc...@gmail.com on 23 Oct 2014 at 7:38

@GoogleCodeExporter
Copy link
Author

The easiest thing is to just change that line that mentions 
platform_thread_linux to mention the BSD one. That's not the sort of change 
Chromium people would accept as a patch, but if you're patching for one 
platform, that probably doesn't matter.

And yeah, IIRC "_linux" files are also used on FreeBSD, which is often what you 
want, except when they're actually linux-specific and not just generic POSIX 
stuff.

Original comment by morlov...@google.com on 23 Oct 2014 at 7:55

@GoogleCodeExporter
Copy link
Author

Yeah I just changed the linux line to freebsd as a crappy "patch" for now....

third_party/google-sparsehash/src/google/dense_hash_map:100:44: fatal error: 
google/sparsehash/sparseconfig.h: No such file or directory

is the next one... third_party/google-sparsehash/gen/arch is missing freebsd 
too :)

Original comment by miguelmc...@gmail.com on 23 Oct 2014 at 8:02

@GoogleCodeExporter
Copy link
Author

pagespeed/kernel/base/symbol_table.cc:47:32:   required from 
'net_instaweb::SymbolTable<CharTransform>::SymbolTable() [with CharTransform = 
net_instaweb::CaseFold]'
pagespeed/kernel/base/symbol_table.cc:120:16:   required from here
third_party/google-sparsehash/src/google/sparsehash/hashtable-common.h:158:50: 
error: exception handling disabled, use -fexceptions to enable
         throw std::length_error("resize overflow");  // protect against overflow
                                                  ^
gmake: *** 
[out/Release/obj.target/pagespeed_base_core/pagespeed/kernel/base/symbol_table.o
] Error 1


Possible patch
--- home/miguelc/mod_pagespeed/src/build/common.gypi.orig    2014-10-23 
21:26:06.004607474 +0100
+++ /home/miguelc/mod_pagespeed/src/build/common.gypi   2014-10-23 
21:25:17.497610901 +0100
@@ -45,7 +45,7 @@

     'conditions': [
       # TODO(morlovich): AIX, Solaris, FreeBSD10?
-      ['OS == "linux"', {
+      ['OS == "linux" or OS == "freebsd"', {
         'support_posix_shared_mem': 1
       }],
       ['use_system_libs==1', {
@@ -71,7 +71,7 @@
       ['support_posix_shared_mem == 1', {
         'defines': [ 'PAGESPEED_SUPPORT_POSIX_SHARED_MEM', ],
       }],
-      ['OS == "linux"', {
+      ['OS == "linux" or OS == "freebsd"', {
         # Disable -Werror when not using the version of gcc that development
         # is generally done with, to avoid breaking things for users with
         # something older or newer (which produces different warnings).

I say possible because some parts here might not apply to both freebsd and 
linux, so far its building and not complaining, the cflags part is surely 
needed.... not sure about:
"['use_system_libs==1'" for example.

Original comment by miguelmc...@gmail.com on 23 Oct 2014 at 8:36

@GoogleCodeExporter
Copy link
Author

Almost had it :|

  g++ '-DCHROMIUM_REVISION=256281' '-DV8_DEPRECATION_WARNINGS' '-DBLINK_SCALE_FILTERS_AT_RECORD_TIME' '-D_FILE_OFFSET_BITS=64' '-DPAGESPEED_SUPPORT_POSIX_SHARED_MEM' '-DGTEST_HAS_RTTI=1' '-DCHROMIUM_BUILD' '-DUSE_CAIRO=1' '-DUSE_GLIB=1' '-DUSE_DEFAULT_RENDER_THEME=1' '-DUSE_LIBJPEG_TURBO=1' '-DUSE_NSS=1' '-DUSE_X11=1' '-DGTK_DISABLE_SINGLE_INCLUDES=1' '-DUSE_XI2_MT=2' '-DENABLE_REMOTING=1' '-DENABLE_WEBRTC=1' '-DENABLE_CONFIGURATION_POLICY' '-DENABLE_INPUT_SPEECH' '-DENABLE_NOTIFICATIONS' '-DENABLE_NEW_GAMEPAD_API=1' '-DENABLE_EGLIMAGE=1' '-DENABLE_TASK_MANAGER=1' '-DENABLE_EXTENSIONS=1' '-DENABLE_PLUGIN_INSTALLATION=1' '-DENABLE_PLUGINS=1' '-DENABLE_SESSION_SERVICE=1' '-DENABLE_THEMES=1' '-DENABLE_BACKGROUND=1' '-DENABLE_AUTOMATION=1' '-DENABLE_GOOGLE_NOW=1' '-DCLD_VERSION=2' '-DENABLE_FULL_PRINTING=1' '-DENABLE_PRINTING=1' '-DENABLE_SPELLCHECK=1' '-DENABLE_CAPTIVE_PORTAL_DETECTION=1' '-DENABLE_MANAGED_USERS=1' '-DURL_IMPLEMENTATION' '-DU_USING_ICU_NAMESPACE=0' '-DU_STATIC_IMPLEMENTATION' '-D__STDC_CONSTANT_MACROS' '-D__STDC_FORMAT_MACROS' '-DNDEBUG' '-DNVALGRIND' '-DDYNAMIC_ANNOTATIONS_ENABLED=0' '-D_FORTIFY_SOURCE=2' -Ithird_party/chromium/src -I. -Ithird_party/icu/source/common -Ithird_party/icu/genfiles/arch/freebsd/common/include  -fstack-protector --param=ssp-buffer-size=4 -Werror -pthread -fno-exceptions -fno-strict-aliasing -Wall -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -Wno-unused-local-typedefs -fexceptions -fasynchronous-unwind-tables -Wno-unused-but-set-variable -Wno-unused-but-set-variable -O2 -fno-ident -fdata-sections -ffunction-sections -funwind-tables -fno-threadsafe-statics -fvisibility-inlines-hidden -frtti -MMD -MF out/Release/.deps/out/Release/obj.target/url_lib/third_party/chromium/src/url/url_canon_icu.o.d.raw  -c -o out/Release/obj.target/url_lib/third_party/chromium/src/url/url_canon_icu.o third_party/chromium/src/url/url_canon_icu.cc
In file included from third_party/icu/source/common/unicode/unistr.h:32:0,
                 from third_party/icu/source/common/unicode/strenum.h:14,
                 from third_party/icu/source/common/unicode/uenum.h:24,
                 from ./third_party/icu/source/common/unicode/ucnv.h:51,
                 from third_party/chromium/src/url/url_canon_icu.cc:12:
third_party/icu/source/common/unicode/stringpiece.h:74:31: error: 'string' does 
not name a type
   StringPiece(const U_STD_NSQ string& str)
                               ^
third_party/icu/source/common/unicode/stringpiece.h:74:39: error: ISO C++ 
forbids declaration of 'str' with no type [-fpermissive]
   StringPiece(const U_STD_NSQ string& str)
                                       ^
third_party/icu/source/common/unicode/stringpiece.h: In constructor 
'StringPiece_46::StringPiece_46(const int&)':
third_party/icu/source/common/unicode/stringpiece.h:75:16: error: request for 
member 'data' in 'str', which is of non-class type 'const int'
     : ptr_(str.data()), length_(static_cast<int32_t>(str.size())) { }
                ^
third_party/icu/source/common/unicode/stringpiece.h:75:58: error: request for 
member 'size' in 'str', which is of non-class type 'const int'
     : ptr_(str.data()), length_(static_cast<int32_t>(str.size())) { }

(Not sure if I should open a new issue about this one... might not be a freebsd 
specific issue)

Original comment by miguelmc...@gmail.com on 23 Oct 2014 at 8:51

@GoogleCodeExporter
Copy link
Author

I guess somehow U_STD_NSQ isn't defined to std:: as it should be. 

Also, you probably want 'support_posix_shared_mem': 0 on FreeBSD ---- it didn't 
have a working pthread_mutexattr_setpshared last I checked, and providing it 
was a rather invasive (and ABI-incompatible) change at that point (and I can't 
find a manpage for it in 10...)


Original comment by morlov...@google.com on 23 Oct 2014 at 9:10

@GoogleCodeExporter
Copy link
Author

so std::U_STD_NSQ fixes it here.... but is it the best way? I'm not much of a 
c/c++ coder, I wonder if there's a missing "using" somewhere?

I agree about the shared_mem part pthread_mutexattr_setpshared doesn't seem to 
be supported.

Original comment by miguelmc...@gmail.com on 24 Oct 2014 at 3:43

@GoogleCodeExporter
Copy link
Author

I can't get a break damn :P

In file included from third_party/icu/source/common/brkeng.cpp:26:0:
third_party/icu/source/common/brkeng.cpp: In member function 'virtual const 
CompactTrieDictionary_46* 
ICULanguageBreakFactory_46::loadDictionaryFor(UScriptCode, int32_t)':
third_party/icu/source/common/ubrkimpl.h:11:41: error: expected ')' before 
'U_TREE_SEPARATOR_STRING'
 #define U_ICUDATA_BRKITR U_ICUDATA_NAME U_TREE_SEPARATOR_STRING "brkitr"
                                         ^
third_party/icu/source/common/brkeng.cpp:252:36: note: in expansion of macro 
'U_ICUDATA_BRKITR'
     UResourceBundle *b = ures_open(U_ICUDATA_BRKITR, "", &status);
                                    ^
third_party/icu/source/common/ubrkimpl.h:11:41: error: expected ')' before 
'U_TREE_SEPARATOR_STRING'
 #define U_ICUDATA_BRKITR U_ICUDATA_NAME U_TREE_SEPARATOR_STRING "brkitr"
                                         ^
third_party/icu/source/common/brkeng.cpp:272:36: note: in expansion of macro 
'U_ICUDATA_BRKITR'
     UDataMemory *file = udata_open(U_ICUDATA_BRKITR, ext, dictnbuff, &status);
                                    ^
gmake: *** 
[out/Release/obj.target/icuuc/third_party/icu/source/common/brkeng.o] Error 1


Original comment by miguelmc...@gmail.com on 24 Oct 2014 at 4:30

@GoogleCodeExporter
Copy link
Author

I found the old port files (https://svn.redports.org/melvyn/www/mod_pagespeed/) 
hopefully they will help a bit.. I see some patches I needed here are in the 
port, but much is different too.

I have a doubt though.... the port uses "GYP_DEFINES+= ...."

I wsa trying to use :
gmake V=1 (.....) \                                                             

GYP_DEFINES+=use_system_libs=1\
mod_pagespeed_test pagespeed_automatic_test

(I'll probably also need to pass the LDFLAGS to include the local paths... but 
doing that is not realy setting the value to 1, am I doing it wrong? (In any 
case for now I can simply change the value in the file it self, but just wanted 
to understand why It fails - and sorry if its a noob question )

Original comment by miguelmc...@gmail.com on 24 Oct 2014 at 2:40

@GoogleCodeExporter
Copy link
Author

Not sure. gyp is the tool that generates makefile, but it can also regenerate 
makefiles... Sometimes, perhaps that will cause it to re-run gyp with that flag.
I just run gyp -Duse_system_libs=1 directly.

One of advantages of doing that is that it won't try to compile ICU, and use 
whatever is installed (if it can find it), which is one way of dealing with the 
above problem.

Anyway, ICU also has a genfiles/arch/linux dir --- symlinking that as 
gen/arch/freebsd might help.

Original comment by morlov...@google.com on 24 Oct 2014 at 3:00

@GoogleCodeExporter
Copy link
Author

Bummer... seems to be set in a few places.... I'll see if I can #if 
!defined(__FreeBSD__) all of the cases where this EXPECT_DEATH etc cases show 
up, If they are not that many...


the proper way however would be to test if "death tests" are support, I believe 
its how its done in chromium using "GTEST_HAS_DEATH_TEST" (which will or will 
not be defined by gtest depending on the OS, or so it seems: 
https://github.com/smarr/googletest/blob/2ccb2496fef815a1c18fcbc79c178f6cb4b5f98
2/include/gtest/internal/gtest-port.h)

Original comment by miguelmc...@gmail.com on 29 Oct 2014 at 1:27

@GoogleCodeExporter
Copy link
Author

The good news is that after a few if's it finally builds successfully :)

But not so luck with building pagespeed_automatic.a which is what I need for 
ngx_pagespeed

       AR.target="$PWD/../../../build/wrappers/ar.sh" \                                                                                                                        CXX.target=g++ \                                                                                                                                                        CC.target=gcc \                                                                                                                                                         all
cd /home/miguelc/mod_pagespeed/src && gmake  BUILDTYPE=Release
gmake[1]: Entering directory '/usr/home/miguelc/mod_pagespeed/src'
  LD_LIBRARY_PATH=/usr/home/miguelc/mod_pagespeed/src/out/Release/lib.host:/usr/home/miguelc/mod_pagespeed/src/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd build; mkdir -p /usr/home/miguelc/mod_pagespeed/src/out/Release/obj/gen/build; /bin/sh ../build/lastchange.sh .. -o "/usr/home/miguelc/mod_pagespeed/src/out/Release/obj/gen/build/LASTCHANGE" -d ../LASTCHANGE.in
  LD_LIBRARY_PATH=/usr/home/miguelc/mod_pagespeed/src/out/Release/lib.host:/usr/home/miguelc/mod_pagespeed/src/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd build; mkdir -p /usr/home/miguelc/mod_pagespeed/src/out/Release/obj/gen/net/instaweb/public; python version.py -f ../net/instaweb/public/VERSION -f "/usr/home/miguelc/mod_pagespeed/src/out/Release/obj/gen/build/LASTCHANGE" ../net/instaweb/public/version.h.in "/usr/home/miguelc/mod_pagespeed/src/out/Release/obj/gen/net/instaweb/public/version.h"
gmake[1]: Leaving directory '/usr/home/miguelc/mod_pagespeed/src'
gmake --no-print-directory examples
/usr/local/bin/g++ -I/home/miguelc/mod_pagespeed/src 
-I/home/miguelc/mod_pagespeed/src/out/Release/obj/gen/protoc_out/instaweb 
-I/home/miguelc/mod_pagespeed/src/third_party/chromium/src 
-I/home/miguelc/mod_pagespeed/src/third_party/gflags/gen/arch/linux/x64/include 
-I/home/miguelc/mod_pagespeed/src/third_party/google-sparsehash/src 
-I/home/miguelc/mod_pagespeed/src/third_party/google-sparsehash/gen/arch/linux/x
64/include -I/home/miguelc/mod_pagespeed/src/third_party/protobuf/src 
-I/home/miguelc/mod_pagespeed/src/third_party/re2/src -I/usr/local/include PSOL 
= /home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a 
-g  -c static_rewriter_main.cc -o 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/static_rewriter_main.o
g++: error: PSOL: No such file or directory
g++: error: =: No such file or directory
g++: error: 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a: 
No such file or directory
Makefile:275: recipe for target 
'/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/static_rewriter_main.o' 
failed
gmake[1]: *** 
[/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/static_rewriter_main.o] 
Error 1
Makefile:250: recipe for target 'all' failed
gmake: *** [all] Error 2

Original comment by miguelmc...@gmail.com on 29 Oct 2014 at 3:10

@GoogleCodeExporter
Copy link
Author

Hmm, one thing that seems suspicious in that neighborhood:
~/modpagespeed/gslb-th/src/net/instaweb/automatic/Makefile, lime 213 or so 
explicitly uses make rather than $(MAKE).

Original comment by morlov...@google.com on 29 Oct 2014 at 2:22

@GoogleCodeExporter
Copy link
Author

I've changed that already or else I couldn't even get to the error, it  would 
complain about missing operators and sure and so I noticed that it was 
explicitly doing that...

The issue now seem to be:
"g++: error: PSOL: No such file or directory"

Original comment by miguelmc...@gmail.com on 29 Oct 2014 at 10:43

@GoogleCodeExporter
Copy link
Author

I got it it was caused by me, while adding "-I/usr/local/include" I leaft a "/" 
at the end of the line so PSOL was being added to the include path!

Original comment by miguelmc...@gmail.com on 29 Oct 2014 at 11:33

@GoogleCodeExporter
Copy link
Author

This is were it end now:
$ gmake BUILDTYPE=Release \                                                     

               AR.host="$PWD/../../../build/wrappers/ar.sh" \                   

                       AR.target="$PWD/../../../build/wrappers/ar.sh" \         

                             CC.target=gcc\                                     

                                     all
cd /home/miguelc/mod_pagespeed/src && gmake --no-print-directory  
BUILDTYPE=Release
  ACTION Extracting last change to /usr/home/miguelc/mod_pagespeed/src/out/Release/obj/gen/build/LASTCHANGE out/Release/obj/gen/build/LASTCHANGE.always
  ACTION Generating version header file: "/usr/home/miguelc/mod_pagespeed/src/out/Release/obj/gen/net/instaweb/public/version.h" out/Release/obj/gen/net/instaweb/public/version.h
gmake --no-print-directory examples
Merging libraries, logs in 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/merge.log ...
ar: warning: creating 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a.dir
ty
Cleaning namespace, logs in 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/rename.log ...
Makefile:260: recipe for target 
'/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a' 
failed
gmake[1]: *** 
[/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a] 
Error 1
Makefile:251: recipe for target 'all' failed
gmake: *** [all] Error 2


https://github.com/pagespeed/ngx_pagespeed/wiki/Building-PSOL-From-Source 
refers that make all will always fail... I'm hopping the dirty 
pagespeed_automatic.a is all I need :|

Original comment by miguelmc...@gmail.com on 29 Oct 2014 at 11:34

@GoogleCodeExporter
Copy link
Author

Hum... while building nginx with ngx_pagespeed It fails :

----------------------------------------
checking for psol

/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a(91.
html_parse.o.o): In function 
`net_instaweb::HtmlParse::HtmlParse(net_instaweb::MessageHa
ndler*)':
html_parse.cc:(.text._ZN12net_instaweb9HtmlParseC2EPNS_14MessageHandlerE+0x2d8):
 undefined reference to `GURL::~GURL()'
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a(91.
html_parse.o.o): In function `net_instaweb::HtmlParse::~HtmlParse()':
html_parse.cc:(.text._ZN12net_instaweb9HtmlParseD2Ev+0xf7): undefined reference 
to `GURL::~GURL()'
html_parse.cc:(.text._ZN12net_instaweb9HtmlParseD2Ev+0x24a): undefined 
reference to `GURL::~GURL()'

any idea why the "undefined reference to `GURL::~GURL()" ? 

Original comment by miguelmc...@gmail.com on 30 Oct 2014 at 1:50

@GoogleCodeExporter
Copy link
Author

Not sure... It may be worth trying to see why 
net/instaweb/automatic/merge_libraries.sh fails; stuff won't quite work w/o it 
anyway.

Obvious option may be to hack it to run with bash rather than /bin/sh; also the 
log file  /home/miguelc/mod_pagespeed/src/net/instaweb/automatic/rename.log may 
have some info.

Original comment by morlov...@google.com on 30 Oct 2014 at 2:20

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

Seems I've missplace a comment in the Makefile while trying to fix it... now I 
get 

cd /home/miguelc/mod_pagespeed/src && gmake --no-print-directory  
BUILDTYPE=Release
  ACTION Extracting last change to /usr/home/miguelc/mod_pagespeed/src/out/Release/obj/gen/build/LASTCHANGE out/Release/obj/gen/build/LASTCHANGE.always
  ACTION Generating version header file: "/usr/home/miguelc/mod_pagespeed/src/out/Release/obj/gen/net/instaweb/public/version.h" out/Release/obj/gen/net/instaweb/public/version.h
gmake --no-print-directory examples
gmake[1]: *** No rule to make target 
'/home/miguelc/mod_pagespeed/src/out/Release/obj.target/third_party/apr/libapr.a
', needed by 
'/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a'. 
 Stop.
Makefile:248: recipe for target 'all' failed
gmake: *** [all] Error 2

The BASE_LIBS list seems to directly to the files, but apr should be the 
system's one, and surely others will give problems!

I see in the code:
# TODO(jmarantz): this library-list should be automatically generated
# from the 'gyp' flow, rather than hand-entered here.
BASE_LIBS = \
  base/libbase.a \
  base/libbase_static.a \

So jamrantz is aware of this and probably will be fixed in a more recent build, 
for now I'll point to them manually!

Original comment by miguelmc...@gmail.com on 31 Oct 2014 at 12:00

@GoogleCodeExporter
Copy link
Author

Or just remove the ones pointing to libs I already have on system and use:
-SYSLIBS = -lpthread -lrt
+SYSLIBS = -lpthread -lrt -lapr-1.0 ....

for example... 

Original comment by miguelmc...@gmail.com on 31 Oct 2014 at 12:52

@GoogleCodeExporter
Copy link
Author

I've set "sh -x" on the merge file:

r.o.o 93.caching_headers.o.o 93.content_type.o.o 93.google_url.o.o 
93.http_names.o.o 93.query_params.o.o 93.semantic_type.o.o 
94.bot_checker.gp.o.o 95.http.pb.o.o 96.gif_reader.o.o 96.image_analysis.o.o 
96.image_converter.o.o 96.image_frame_interface.o.o 96.image_resizer.o.o 
96.image_util.o.o 96.jpeg_optimizer.o.o 96.jpeg_reader.o.o 96.jpeg_utils.o.o 
96.pixel_format_optimizer.o.o 96.png_optimizer.o.o 96.read_image.o.o 
96.scanline_interface_frame_adapter.o.o 96.scanline_utils.o.o 
96.webp_optimizer.o.o 97.js_keywords.gp.o.o 98.inprocess_shared_mem.o.o 
98.shared_circular_buffer.o.o 98.shared_dynamic_string_map.o.o 
98.shared_mem_cache.o.o 98.shared_mem_cache_data.o.o 
98.shared_mem_lock_manager.o.o 98.shared_mem_statistics.o.o 
99.shared_mem_cache_snapshot.pb.o.o
+ echo ranlib 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a.dir
ty
+ ranlib 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a.dir
ty
+ ls -l 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a.dir
ty
+ rm -rf /tmp/merge_libraries.miguelc.31553
Cleaning namespace, logs in 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/rename.log ...
sh -x ./rename_c_symbols.sh 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a.dir
ty /home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a 
> /home/miguelc/mod_pagespeed/src/net/instaweb/automatic/rename.log
+ set -e
+ set -u
+ readlink -f 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a.dir
ty
+ 
IN=/usr/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automati
c.a.dirty
+ readlink -f 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a
+ OUT=''
Makefile:251: recipe for target 
'/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a' 
failed
gmake[1]: *** 
[/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a] 
Error 1
Makefile:242: recipe for target 'all' failed
gmake: *** [all] Error 2


Don't see much more info I'm afraid... except that "OUT" is '' and maybe 
shouldn't?

Original comment by miguelmc...@gmail.com on 31 Oct 2014 at 2:51

@GoogleCodeExporter
Copy link
Author

re: libapr.a --- yep, they will have to be removed manually, and corresponding 
-l lines also added to ngx_pagespeed's config file.
Basically the build tool we use doesn't really do static libraries as output 
(last I checked), so we have to hand-make them.

rr: last comment: seems like readlink -f behaves differently on freebsd when 
the file doesn't exist. It will probably work to just set OUT=$2

Original comment by morlov...@google.com on 31 Oct 2014 at 12:27

@GoogleCodeExporter
Copy link
Author

Hum... readlink on freebsd show's no output if not found, and shows the path if 
found (IMHO makes more sense then showing the path in both cases, however the 
exit code should still tell if it worked or not.

for nginx I'm using:
MOD_PAGESPEED_DIR="$HOME/mod_pagespeed/src" ./configure  
--prefix=/usr/local/etc/nginx --with-cc-opt='-I /usr/local/include' 
--with-ld-opt='-L /usr/local/lib' --conf-path=/usr/local/etc/nginx/nginx.conf 
--sbin-path=/usr/local/sbin/nginx --pid-path=/var/run/nginx.pid 
--error-log-path=/var/log/nginx-error.log --user=www --group=www --with-ipv6 
--with-google_perftools_module 
--http-client-body-temp-path=/var/tmp/nginx/client_body_temp 
--http-fastcgi-temp-path=/var/tmp/nginx/fastcgi_temp 
--http-proxy-temp-path=/var/tmp/nginx/proxy_temp 
--http-scgi-temp-path=/var/tmp/nginx/scgi_temp 
--http-uwsgi-temp-path=/var/tmp/nginx/uwsgi_temp 
--http-log-path=/var/log/nginx-access.log --with-http_gzip_static_module 
--with-http_gunzip_module --with-http_image_filter_module 
--with-http_stub_status_module --with-http_xslt_module --with-pcre 
--with-http_spdy_module --with-http_ssl_module 
--add-module=$HOME/gitstuff/ngx_pagespeed/


Original comment by miguelmc...@gmail.com on 31 Oct 2014 at 1:08

@GoogleCodeExporter
Copy link
Author

The script also uses set -e, so the readlink command failing results in the 
script straight up exiting, like you saw.

Original comment by morlov...@google.com on 31 Oct 2014 at 1:13

@GoogleCodeExporter
Copy link
Author

readlink issue fixed, I still get a error:

+ rm /tmp/tmp.7B4Glal1
+ objcopy -v --redefine-syms /tmp/tmp.7Ec7UNQU 
/usr/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a
.dirty 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a
+ echo ranlib 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a
+ ranlib 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a
rm 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a.dir
ty
/usr/local/bin/g++ -I/home/miguelc/mod_pagespeed/src -I/usr/local/include 
-I/usr/include 
-I/home/miguelc/mod_pagespeed/src/out/Release/obj/gen/protoc_out/instaweb 
-I/home/miguelc/mod_pagespeed/src/third_party/chromium/src 
-I/home/miguelc/mod_pagespeed/src/third_party/gflags/gen/arch/freebsd/x64/includ
e -I/home/miguelc/mod_pagespeed/src/third_party/google-sparsehash/src 
-I/home/miguelc/mod_pagespeed/src/third_party/google-sparsehash/gen/arch/freebsd
/x64/include -I/home/miguelc/mod_pagespeed/src/third_party/protobuf/src 
-I/home/miguelc/mod_pagespeed/src/third_party/re2/src  -g  -c 
static_rewriter_main.cc -o 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/static_rewriter_main.o
/usr/local/bin/g++ -I/home/miguelc/mod_pagespeed/src -I/usr/local/include 
-I/usr/include 
-I/home/miguelc/mod_pagespeed/src/out/Release/obj/gen/protoc_out/instaweb 
-I/home/miguelc/mod_pagespeed/src/third_party/chromium/src 
-I/home/miguelc/mod_pagespeed/src/third_party/gflags/gen/arch/freebsd/x64/includ
e -I/home/miguelc/mod_pagespeed/src/third_party/google-sparsehash/src 
-I/home/miguelc/mod_pagespeed/src/third_party/google-sparsehash/gen/arch/freebsd
/x64/include -I/home/miguelc/mod_pagespeed/src/third_party/protobuf/src 
-I/home/miguelc/mod_pagespeed/src/third_party/re2/src  -g  -c 
static_rewriter.cc -o 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/static_rewriter.o
/usr/local/bin/g++ -g -o 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/static_rewriter 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/static_rewriter_main.o 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/static_rewriter.o 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a 
-lpthread -lrt -lcrypto -lz  -lcrypto -lssl -lapr-1 -licudata -licuuc -ljpeg
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/static_rewriter 
--rewriters=collapse_whitespace 
/home/miguelc/mod_pagespeed/src/install/mod_pagespeed_example 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic \
                collapse_whitespace.html
Makefile:273: recipe for target 
'/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/collapse_whitespace.html
' failed
gmake[1]: *** 
[/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/collapse_whitespace.html
] Segmentation fault (core dumped)
Makefile:242: recipe for target 'all' failed

tried to build ngx_pagespeed anywway but failed, the error seems unrelated to 
the witespace failure though (or maybe not... what do I know :) )

attaching the log

Original comment by miguelmc...@gmail.com on 31 Oct 2014 at 4:22

Attachments:

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author


tr1 issue fixed with:

--- 
src/third_party/google-sparsehash/gen/arch/freebsd/x64/include/google/sparsehash
/sparseconfig.h   2014-11-03 16:53:50.119845519 +0000
+++ 
src/third_party/google-sparsehash/gen/arch/linux/x64/include/google/sparsehash/s
parseconfig.h     2014-10-23 17:05:15.644683988 +0100
@@ -11,5 +11,5 @@

 /* the namespace of the hash<> function */
-#define HASH_NAMESPACE std
+#define HASH_NAMESPACE std::tr1

 /* Define to 1 if you have the <inttypes.h> header file. */

Found the fix here: 
https://lists.freebsd.org/pipermail/freebsd-ports-bugs/2014-March/274533.html




Original comment by miguelmc...@gmail.com on 3 Nov 2014 at 5:03

@GoogleCodeExporter
Copy link
Author

Actually that fixes it for ngx_pagespeed, but breaks the build of 
"pagespeed_automatic.a"

But, a port of google's sparsehash exists, so I'll try to use that instead.

Original comment by miguelmc...@gmail.com on 3 Nov 2014 at 5:41

@GoogleCodeExporter
Copy link
Author

Using the ports version avoids any issues abouve but I get:
./pagespeed/kernel/base/timer.h:49:11: error: 'int64' does not name a type
   virtual int64 NowMs() const;
           ^
./pagespeed/kernel/base/timer.h:52:11: error: 'int64' does not name a type
   virtual int64 NowUs() const = 0;
           ^
./pagespeed/kernel/base/timer.h:55:24: error: 'int64' has not been declared
   virtual void SleepMs(int64 ms);
                        ^
./pagespeed/kernel/base/timer.h:58:24: error: 'int64' has not been declared
   virtual void SleepUs(int64 us) = 0;
                        ^
pagespeed/kernel/http/http_options.cc:24:7: error: 'kMinuteMs' is not a member 
of 'net_instaweb::Timer'
   5 * Timer::kMinuteMs,  // implicit_cache_ttl_ms
       ^
pagespeed/kernel/http/http_options.cc:26:1: error: too many initializers for 
'const net_instaweb::HttpOptions'


Seems to be missing initypes.h, likely due to the fact that this is defined in 
the genfiles!

Original comment by miguelmc...@gmail.com on 4 Nov 2014 at 2:30

@GoogleCodeExporter
Copy link
Author

Looking a bit more it to the sources.

HAVE_SYS_TYPES_H should add the "#include <sys/types.h>" however even after 
adding it to timer.h I get the same errors :|

Any help is appreciated.

Original comment by miguelmc...@gmail.com on 4 Nov 2014 at 2:58

@GoogleCodeExporter
Copy link
Author

int64 is supposed to be typedef's in 
src/third_party/chromium/src/base/basictypes.h
(included from pagespeed/kernel/base/basictypes.h)

Original comment by morlov...@google.com on 4 Nov 2014 at 3:20

@GoogleCodeExporter
Copy link
Author

pagespeed/kernel/base/basictypes.h

Includes "base/basictypes.h" but I'm not sure what's the "root" for that... 

https://code.google.com/p/modpagespeed/source/browse/trunk/src/pagespeed/kernel/
base/basictypes.h


Original comment by miguelmc...@gmail.com on 4 Nov 2014 at 7:29

@GoogleCodeExporter
Copy link
Author

The "root" should be ./third_party/chromium/src/.  Maybe on BSD it's 
considering .. to be a valid root?  In which case it #includes itself, hits the 
includeguard, and moves on?  You could try renaming the file...

Original comment by jefftk@google.com on 6 Nov 2014 at 4:19

@GoogleCodeExporter
Copy link
Author

trying:
svn diff ~/mod_pagespeed/src/pagespeed/kernel/base/basictypes.h                 
        Index: 
/home/miguelc/mod_pagespeed/src/pagespeed/kernel/base/basictypes.h
===================================================================
--- /home/miguelc/mod_pagespeed/src/pagespeed/kernel/base/basictypes.h  
(revision 4322)
+++ /home/miguelc/mod_pagespeed/src/pagespeed/kernel/base/basictypes.h  
(working copy)
@@ -18,7 +18,7 @@
 #define PAGESPEED_KERNEL_BASE_BASICTYPES_H_


-#include "base/basictypes.h"
+#include "third_party/chromium/src/base/basictypes.h"

 // The FALLTHROUGH_INTENDED macro can be used to annotate implicit fall-through
 // between switch labels:


Which fixes that but then:
                 from static_rewriter_main.cc:21:
/home/miguelc/mod_pagespeed/src/third_party/chromium/src/base/basictypes.h:18:25
: fatal error: base/macros.h: No such file or directory


Missing the "root" path again...
Note that this is building "/mod_pagespeed/src/net/instaweb/automatic" and 
after I moved to using the systems (port) google sparsehash so maybe the 
"chromium root" is not being set now... but AFAIK this is set on 
base/base.gyp... 

The alternative is to use the full paths if similar issue come up  guess!

Original comment by miguelmc...@gmail.com on 7 Nov 2014 at 3:19

@GoogleCodeExporter
Copy link
Author

Nvm, my bad accidentally removed: -    
-I$(MOD_PAGESPEED_ROOT)/third_party/chromium/src \

from the Makefile duh!!!

Original comment by miguelmc...@gmail.com on 7 Nov 2014 at 3:29

@GoogleCodeExporter
Copy link
Author

With the changes to the Makefile I still get an error (but psol builds or so it 
seems)

g++ -g -o 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/static_rewriter 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/static_rewriter_main.o 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/static_rewriter.o 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a 
-Wl, -lpthread -lrt -lcrypto -lz  -lcrypto -lssl -lprotobuf -lapr-1 -licudata 
-licuuc -ljpeg
/usr/local/bin/ld: cannot find : No such file or directory
collect2: error: ld returned 1 exit status
Makefile:267: recipe for target 
'/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/static_rewriter' failed
gmake[1]: *** 
[/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/static_rewriter] Error 1
Makefile:239: recipe for target 'all' failed
gmake: *** [all] Error 2

"static_rewriter" fails but do I need it for ngx_pagespeed? I have no clue, the 
docs suggest page generating "pagespeed_automatic.a" is enough.

building nginx however still fails while checking for psol...


===
----------------------------------------
checking for psol

In file included from objs/autotest.cc:8:
In file included from 
/home/miguelc/mod_pagespeed/src/pagespeed/kernel/html/html_parse.h:36:
In file included from 
/home/miguelc/mod_pagespeed/src/pagespeed/kernel/base/symbol_table.h:31:
In file included from 
/home/miguelc/mod_pagespeed/src/pagespeed/kernel/base/dense_hash_map.h:21:
In file included from /usr/local/include/google/dense_hash_map:34:
In file included from /usr/local/include/sparsehash/dense_hash_map:104:
In file included from 
/usr/local/include/sparsehash/internal/densehashtable.h:102:
/usr/local/include/sparsehash/type_traits.h:94:41: error: expected class name
template <class T> struct is_integral : false_type { };
                                        ^
/usr/local/include/sparsehash/type_traits.h:95:39: error: expected class name
template<> struct is_integral<bool> : true_type { };
                                      ^
/usr/local/include/sparsehash/type_traits.h:96:39: error: expected class name
template<> struct is_integral<char> : true_type { };
                                      ^
/usr/local/include/sparsehash/type_traits.h:97:48: error: expected class name
template<> struct is_integral<unsigned char> : true_type { };
                                               ^
/usr/local/include/sparsehash/type_traits.h:98:46: error: expected class name
template<> struct is_integral<signed char> : true_type { };
                                             ^
/usr/local/include/sparsehash/type_traits.h:105:42: error: expected class name
template<> struct is_integral<wchar_t> : true_type { };
===
Full log attached!


Original comment by miguelmc...@gmail.com on 8 Nov 2014 at 3:13

@jeffkaufman
Copy link
Contributor

Tracking this in #1073

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants