diff --git a/component/w3m/buildout.cfg b/component/w3m/buildout.cfg
index 32e55e2d09b071cf15afe4ca3948b4f246923082..abc351ab493899346d7afe8488ae03baed754c98 100644
--- a/component/w3m/buildout.cfg
+++ b/component/w3m/buildout.cfg
@@ -9,6 +9,18 @@ extends =
 parts =
   w3m
 
+versions = versions
+
+find-links =
+    http://www.nexedi.org/static/packages/source/slapos.buildout/
+
+[w3m-w3m.gcc.forward.compat.patch]
+recipe = hexagonit.recipe.download
+url =${:_profile_base_location_}/${:filename}
+filename = w3m.gcc.forward.compat.patch
+download-only = true
+md5sum = 75422a6f7f671b3a6d9add6724cc0945
+
 [w3m]
 recipe = hexagonit.recipe.cmmi
 md5sum = 1b845a983a50b8dec0169ac48479eacc
@@ -27,8 +39,18 @@ configure-options =
   --disable-external-uri-loader
   --disable-w3mmailer
 
+patch-options =
+  -p1
+
+patches =
+  ${w3m-w3m.gcc.forward.compat.patch:location}/${w3m-w3m.gcc.forward.compat.patch:filename}
+
 environment =
   PATH=${pkgconfig:location}/bin:%(PATH)s
   PKG_CONFIG_PATH=${openssl:location}/lib/pkgconfig
   CPPFLAGS=-I${ncurses:location}/include/ -I${zlib:location}/include/
   LDFLAGS=-Wl,--as-needed -L${garbage-collector:location}/lib -Wl,-rpath=${garbage-collector:location}/lib -L${ncurses:location}/lib -Wl,-rpath=${ncurses:location}/lib -L${openssl:location}/lib -Wl,-rpath=${openssl:location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib
+
+[versions]
+# Use SlapOS patched zc.buildout
+zc.buildout = 1.5.3-dev-SlapOS-004
diff --git a/component/w3m/w3m.gcc.forward.compat.patch b/component/w3m/w3m.gcc.forward.compat.patch
new file mode 100644
index 0000000000000000000000000000000000000000..892ff75384269ecde2adc08f35efd15523f45a33
--- /dev/null
+++ b/component/w3m/w3m.gcc.forward.compat.patch
@@ -0,0 +1,62 @@
+diff --git a/istream.c b/istream.c
+index 8967280..d4c788a 100644
+--- a/istream.c
++++ b/istream.c
+@@ -22,8 +22,8 @@
+ static void basic_close(int *handle);
+ static int basic_read(int *handle, char *buf, int len);
+ 
+-static void file_close(struct file_handle *handle);
+-static int file_read(struct file_handle *handle, char *buf, int len);
++static void file_close(struct w3m_file_handle *handle);
++static int file_read(struct w3m_file_handle *handle, char *buf, int len);
+ 
+ static int str_read(Str handle, char *buf, int len);
+ 
+@@ -114,7 +114,7 @@ newFileStream(FILE * f, void (*closep) ())
+     stream = New(union input_stream);
+     init_base_stream(&stream->base, STREAM_BUF_SIZE);
+     stream->file.type = IST_FILE;
+-    stream->file.handle = New(struct file_handle);
++    stream->file.handle = New(struct w3m_file_handle);
+     stream->file.handle->f = f;
+     if (closep)
+ 	stream->file.handle->close = closep;
+@@ -658,13 +658,13 @@ basic_read(int *handle, char *buf, int len)
+ }
+ 
+ static void
+-file_close(struct file_handle *handle)
++file_close(struct w3m_file_handle *handle)
+ {
+     handle->close(handle->f);
+ }
+ 
+ static int
+-file_read(struct file_handle *handle, char *buf, int len)
++file_read(struct w3m_file_handle *handle, char *buf, int len)
+ {
+     return fread(buf, 1, len, handle->f);
+ }
+diff --git a/istream.h b/istream.h
+index a220d8b..6d9736d 100644
+--- a/istream.h
++++ b/istream.h
+@@ -20,7 +20,7 @@ struct stream_buffer {
+ 
+ typedef struct stream_buffer *StreamBuffer;
+ 
+-struct file_handle {
++struct w3m_file_handle {
+     FILE *f;
+     void (*close) ();
+ };
+@@ -53,7 +53,7 @@ struct base_stream {
+ 
+ struct file_stream {
+     struct stream_buffer stream;
+-    struct file_handle *handle;
++    struct w3m_file_handle *handle;
+     char type;
+     char iseos;
+     int (*read) ();