compiling plugins

Hi,

I'm trying to build a chromium plugin, but this is valid for clang-check too.

I'm getting the following error when running "make" in
~/llvm/tools/clang/tools/clang-check or
~/llvm/tools/clang/tools/chrome-plugin:

../../../../Makefile.common:60: ../../../../Makefile.config: No such
file or directory
../../../../Makefile.common:68: /Makefile.rules: No such file or directory
make: *** No rule to make target `/Makefile.rules'. Stop.

I guess I want to use ninja here instead of make, but chrome-plugin
does not have cmake files nor build.ninja just a Makefile. Clang-check
has a CMakeLists.txt, but I'm unsure
how to generate the ninja files from it.

Help?

Thanks,

PS: Please, keep me in CC list as I am not subscribed! That happened
in another thread. btw.

/Makefile.rules suggests that there is a reference to
$(SOME_MAKE_VARIABLE)/Makefile.rules and SOME_MAKE_VARIABLE is empty.

Run "make -p" and/or read the makefiles to try to establish which make
variable is not set.
Take a look at remake, which is make with more helpful output.

Csaba

Hi Thiago,

Hi,

I'm trying to build a chromium plugin

you can use tools/clang/scripts/update.sh --force-local-build (in the
chromium tree) to build the plugin locally if you want. This is
documented on the chromium wiki somewhere.

, but this is valid for clang-check too.

I'm getting the following error when running "make" in
~/llvm/tools/clang/tools/clang-check or
~/llvm/tools/clang/tools/chrome-plugin:

../../../../Makefile.common:60: ../../../../Makefile.config: No such
file or directory
../../../../Makefile.common:68: /Makefile.rules: No such file or directory
make: *** No rule to make target `/Makefile.rules'. Stop.

I guess I want to use ninja here instead of make, but chrome-plugin
does not have cmake files nor build.ninja just a Makefile. Clang-check
has a CMakeLists.txt, but I'm unsure
how to generate the ninja files from it.

Help?

http://www.hanshq.net/clang_plugins.html has some notes on how to
build plugins out-of-tree.

Nico

For some reason that I do not know, this does not produce a good clang executable in my 32bit laptop. Hence I’m building clang directly from the official git mirror, outside of chromium tree.

I may try to reproduce it again and post the error message here. Not sure if this is the appropriate place for this though.

Looks like I was mistaken, I think the problem was with my
configuration and/or ninja, not chromium or clang.

Got it now.

But...

[3/109] clang++ -B/usr/local/gold/bin -MMD -MF
obj/base/debug/base.trace_event.o.d -D_FILE_OFFSET_BITS=64
-DCHROMIUM_BUILD -DUSE_NSS=1 -DENABLE_ONE_CLICK_SIGNIN
-DGTK_DISABLE_SINGLE_INCLUDES=1 -DENABLE_REMOTING=1 -DENABLE_WEBRTC=1
-DENABLE_CONFIGURATION_POLICY -DENABLE_INPUT_SPEECH
-DENABLE_NOTIFICATIONS -DENABLE_GPU=1 -DENABLE_EGLIMAGE=1 -DUSE_SKIA=1
-DENABLE_TASK_MANAGER=1 -DENABLE_WEB_INTENTS=1 -DENABLE_EXTENSIONS=1
-DENABLE_PLUGIN_INSTALLATION=1 -DENABLE_PROTECTOR_SERVICE=1
-DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_BACKGROUND=1
-DENABLE_PROMO_RESOURCE_SERVICE=1 -DENABLE_AUTOMATION=1
-DENABLE_PRINTING=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1
-DUSE_SYMBOLIZE -D__STDC_FORMAT_MACROS -DBASE_IMPLEMENTATION
-DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1
-D_DEBUG -I../.. -Werror -pthread -fno-exceptions -fno-strict-aliasing
-Wall -Wno-unused-parameter -Wno-missing-field-initializers
-fvisibility=hidden -pipe -fPIC -Wheader-hygiene -Wno-unused-function
-Wno-char-subscripts -Wno-unnamed-type-template-args
-Wno-c++11-extensions -Wno-covered-switch-default -Xclang -load
-Xclang /home/tfarina/chromium/src/tools/clang/scripts/../../../third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so
-Xclang -add-plugin -Xclang find-bad-constructs -Xclang
-plugin-arg-find-bad-constructs -fcolor-diagnostics -Wno-write-strings
-pthread -I/usr/include/glib-2.0
-I/usr/lib/i386-linux-gnu/glib-2.0/include -pthread
-I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include
-I/usr/include/atk-1.0 -I/usr/include/pango-1.0
-I/usr/include/gio-unix-2.0/ -I/usr/include/freetype2
-I/usr/include/libpng12 -I/usr/include/gtk-2.0
-I/usr/lib/gtk-2.0/include -I/usr/include/cairo
-I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pixman-1
-Wexit-time-destructors -m32 -mmmx -march=pentium4 -msse2 -O0 -g
-fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden
-Wsign-compare -c ../../base/debug/trace_event.cc -o
obj/base/debug/base.trace_event.o
Unknown argument: -o
Unknown argument: -o

Just wondering why it's saying "unknown argument".

$ clang --version # it's in ./third_party/llvm-build/Release+Asserts/bin/
clang version 3.2 (trunk 159409)
Target: i386-pc-linux-gnu
Thread model: posix

So instead of putting the .o file in out/Debug/obj/base/files/, they
are in base/*.o

The way I compiled was:

$ ninja -v -C out/Debug/ base

This seems to be related to clang plugins, this is happening when
running with GYP_DEFINES="clang=1 clang_use_chrome_plugins=1"
./build/gyp_chromium. When running without these flags it doesn't
complain about the -o argument.

This is getting pretty off-topic for this list :slight_smile: You can ask
questions about the chromium clang plugin at clang@chromium.org.

Nico

(ps: Your command line is missing "-Xclang
skip-virtuals-in-implementations" right after
-plugin-arg-find-bad-constructs. build/common.gypi /
tools/clang/scripts/plugin_flags.sh should add that automatically, and
it seems to work fine on the bots.)

My bad. Sorry for the noise, I workaround this problem here.