diff --git a/llvm-general.cabal b/llvm-general.cabal
--- a/llvm-general.cabal
+++ b/llvm-general.cabal
@@ -1,5 +1,5 @@
 name: llvm-general
-version: 3.5.0.0
+version: 3.5.1.0
 license: BSD3
 license-file: LICENSE
 author: Benjamin S.Scarlet <fgthb0@greynode.net>
@@ -37,6 +37,12 @@
   type: git
   location: git://github.com/bscarlet/llvm-general.git
 
+source-repository this
+  type: git
+  location: git://github.com/bscarlet/llvm-general.git
+  branch: llvm-3.5
+  tag: v3.5.1.0
+
 flag shared-llvm
   description: link against llvm shared rather than static library
   default: False
@@ -205,7 +211,7 @@
     HUnit >= 1.2.4.2,
     test-framework-quickcheck2 >= 0.3.0.1,
     QuickCheck >= 2.5.1.1,
-    llvm-general == 3.5.0.0,
+    llvm-general == 3.5.1.0,
     llvm-general-pure == 3.5.0.0,
     containers >= 0.4.2.1,
     mtl >= 2.1,
diff --git a/src/LLVM/General/Internal/FFI/TargetC.cpp b/src/LLVM/General/Internal/FFI/TargetC.cpp
--- a/src/LLVM/General/Internal/FFI/TargetC.cpp
+++ b/src/LLVM/General/Internal/FFI/TargetC.cpp
@@ -264,10 +264,11 @@
 	StringMap<bool> featureMap;
 	std::string features;
 	if (sys::getHostCPUFeatures(featureMap)) {
+		bool first = true;
 		for(llvm::StringMap<bool>::const_iterator it = featureMap.begin(); it != featureMap.end(); ++it) {
-			if (it->second) {
-				features += it->first().str() + " ";
-			}
+			if (!first) { features += ","; }
+			first = false;
+			features += (it->second ? "+" : "-") + it->first().str();
 		}
 	}
 	return strdup(features.c_str());
diff --git a/src/LLVM/General/Internal/Target.hs b/src/LLVM/General/Internal/Target.hs
--- a/src/LLVM/General/Internal/Target.hs
+++ b/src/LLVM/General/Internal/Target.hs
@@ -15,9 +15,11 @@
 
 import Foreign.Ptr
 import Data.List (intercalate)
-import Data.Set (Set)
-import qualified Data.Set as Set
+import Data.Map (Map)
+import qualified Data.Map as Map
 
+import Text.ParserCombinators.Parsec hiding (many)
+
 import LLVM.General.Internal.Coding
 import LLVM.General.Internal.String ()
 import LLVM.General.Internal.LibraryFunction
@@ -75,12 +77,21 @@
 newtype CPUFeature = CPUFeature String
   deriving (Eq, Ord, Read, Show)
 
-instance EncodeM e String es => EncodeM e (Set CPUFeature) es where
-  encodeM = encodeM . intercalate " " . map (\(CPUFeature f) -> f) . Set.toList
-
-instance (Monad d, DecodeM d String es) => DecodeM d (Set CPUFeature) es where
-  decodeM = liftM (Set.fromList . map CPUFeature . words) . decodeM
+instance EncodeM e String es => EncodeM e (Map CPUFeature Bool) es where
+  encodeM = encodeM . intercalate "," . map (\(CPUFeature f, enabled) -> (if enabled then "+" else "-") ++ f) . Map.toList
 
+instance (Monad d, DecodeM d String es) => DecodeM d (Map CPUFeature Bool) es where
+  decodeM es = do
+    s <- decodeM es
+    let flag = do
+          en <- choice [char '-' >> return False, char '+' >> return True]
+          s <- many1 (noneOf ",")
+          return (CPUFeature s, en)
+        features = liftM Map.fromList (flag `sepBy` (char ','))
+    case parse (do f <- features; eof; return f) "CPU Feature string" (s :: String) of
+      Right features -> return features
+      Left _ -> fail "failure to parse CPUFeature string"
+                       
 -- | Find a 'Target' given an architecture and/or a \"triple\".
 -- | <http://llvm.org/doxygen/structllvm_1_1TargetRegistry.html#a3105b45e546c9cc3cf78d0f2ec18ad89>
 -- | Be sure to run either 'initializeAllTargets' or 'initializeNativeTarget' before expecting this to succeed, depending on what target(s) you want to use.
@@ -191,7 +202,7 @@
     Target
     -> String -- ^ triple
     -> String -- ^ cpu
-    -> Set CPUFeature -- ^ features
+    -> Map CPUFeature Bool -- ^ features
     -> TargetOptions
     -> Reloc.Model
     -> CodeModel.Model
@@ -255,7 +266,7 @@
 getHostCPUName = decodeM FFI.getHostCPUName
 
 -- | a space-separated list of LLVM feature names supported by the host CPU
-getHostCPUFeatures :: IO (Set CPUFeature)
+getHostCPUFeatures :: IO (Map CPUFeature Bool)
 getHostCPUFeatures = decodeM =<< FFI.getHostCPUFeatures
 
 -- | 'DataLayout' to use for the given 'TargetMachine'
diff --git a/test/LLVM/General/Test/Module.hs b/test/LLVM/General/Test/Module.hs
--- a/test/LLVM/General/Test/Module.hs
+++ b/test/LLVM/General/Test/Module.hs
@@ -10,7 +10,7 @@
 import Data.Bits
 import Data.Word
 
-import qualified Data.Set as Set
+import qualified Data.Map as Map
 
 import LLVM.General.Context
 import LLVM.General.Module
@@ -259,7 +259,7 @@
       a <- withModuleFromLLVMAssembly' context s $ \m -> do
         (t, _) <- failInIO $ lookupTarget Nothing "x86_64-unknown-linux"
         withTargetOptions $ \to -> do
-          withTargetMachine t "x86_64-unknown-linux" "" Set.empty to R.Default CM.Default CGO.Default $ \tm -> do
+          withTargetMachine t "x86_64-unknown-linux" "" Map.empty to R.Default CM.Default CGO.Default $ \tm -> do
             failInIO $ moduleTargetAssembly tm m
       a @?= "\t.text\n\
             \\t.file\t\"<string>\"\n\
diff --git a/test/LLVM/General/Test/Optimization.hs b/test/LLVM/General/Test/Optimization.hs
--- a/test/LLVM/General/Test/Optimization.hs
+++ b/test/LLVM/General/Test/Optimization.hs
@@ -258,7 +258,7 @@
         let triple = "x86_64"
         (target, _) <- failInIO $ lookupTarget Nothing triple
         withTargetOptions $ \targetOptions -> do
-          withTargetMachine target triple "" Set.empty targetOptions R.Default CM.Default CGO.Default $ \tm -> do
+          withTargetMachine target triple "" Map.empty targetOptions R.Default CM.Default CGO.Default $ \tm -> do
             optimize (defaultPassSetSpec { 
                         transforms = [ T.defaultLoopVectorize ],
                         dataLayout = moduleDataLayout mIn,
diff --git a/test/LLVM/General/Test/Target.hs b/test/LLVM/General/Test/Target.hs
--- a/test/LLVM/General/Test/Target.hs
+++ b/test/LLVM/General/Test/Target.hs
@@ -72,5 +72,8 @@
       withTargetLibraryInfo triple $ \tli -> do
         lf <- getLibraryFunction tli "printf"
         lf @?= Just LF__printf
-   ]
+   ],
+  testCase "Host" $ do
+    features <- getHostCPUFeatures
+    return ()
  ]
