diff --git a/cbits/dso_handle.c b/cbits/dso_handle.c
new file mode 100644
--- /dev/null
+++ b/cbits/dso_handle.c
@@ -0,0 +1,1 @@
+void *__dso_handle;
diff --git a/charsetdetect-ae.cabal b/charsetdetect-ae.cabal
--- a/charsetdetect-ae.cabal
+++ b/charsetdetect-ae.cabal
@@ -1,5 +1,5 @@
 Name:                charsetdetect-ae
-Version:             1.0
+Version:             1.0.1
 Cabal-Version:       >= 1.6
 Category:            Text
 Synopsis:            Character set detection using Mozilla's Universal Character Set Detector
@@ -12,7 +12,7 @@
 License:             LGPL
 License-File:        LICENSE
 Author:              Max Bolingbroke <batterseapower@hotmail.com>
-Maintainer:          Artyom Kazak <yom@artyom.me>
+Maintainer:          Artyom <yom@artyom.me>
 Homepage:            http://github.com/Aelve/charsetdetect-ae
 Build-Type:          Simple
 
@@ -65,10 +65,15 @@
         
         Build-Depends:          base >= 4.2.0.2 && < 5, bytestring >= 0.9.1.7
         
-        -- We really need to ensure that the *final program* links with g++
-        -- It is useless to specify that the library links with it..
-        --Ghc-Options:            -pgml g++
-        
+        -- Needed to ensure correct build on GHC 7.6 when imported by a
+        -- library which uses Template Haskell.
+        --
+        -- See http://stackoverflow.com/a/26454930/615030
+        -- and issue #1.
+        if impl(ghc < 7.8)
+            cc-options: -fno-weak
+            c-sources: cbits/dso_handle.c
+
         -- This is a bit dodgy since g++ might link in more stuff, but will probably work in practice:
         Extra-Libraries:        stdc++
         
