diff --git a/compiler/GHC/Data/FastString.hs b/compiler/GHC/Data/FastString.hs
index 58a96a8fdfdfbcb871fdc6c1b26b6d01b3db1ff8..9ba933f3368a09b89aa5978f50eb10e4e6c32fcb 100644
--- a/compiler/GHC/Data/FastString.hs
+++ b/compiler/GHC/Data/FastString.hs
@@ -131,7 +131,9 @@ import qualified Data.ByteString          as BS
 import qualified Data.ByteString.Char8    as BSC
 import qualified Data.ByteString.Unsafe   as BS
 import qualified Data.ByteString.Short    as SBS
+#if !MIN_VERSION_bytestring(0,11,0)
 import qualified Data.ByteString.Short.Internal as SBS
+#endif
 import Foreign.C
 import System.IO
 import Data.Data
diff --git a/compiler/ghc.cabal.in b/compiler/ghc.cabal.in
index 148d578130ce38aa625c3e2f20c4c51420e59b95..a020c440e8aebcb343d55a218750844b2d8d784f 100644
--- a/compiler/ghc.cabal.in
+++ b/compiler/ghc.cabal.in
@@ -61,7 +61,7 @@ Library
                    deepseq    >= 1.4 && < 1.5,
                    directory  >= 1   && < 1.4,
                    process    >= 1   && < 1.7,
-                   bytestring >= 0.9 && < 0.11,
+                   bytestring >= 0.9 && < 0.12,
                    binary     == 0.8.*,
                    time       >= 1.4 && < 1.12,
                    containers >= 0.6.2.1 && < 0.7,
diff --git a/ghc/ghc-bin.cabal.in b/ghc/ghc-bin.cabal.in
index d29f71ab045d6fb41c824bab5fcbfef831e338a6..047dfd9f3bf92ef84506d11349e970abc5e628f4 100644
--- a/ghc/ghc-bin.cabal.in
+++ b/ghc/ghc-bin.cabal.in
@@ -35,7 +35,7 @@ Executable ghc
     Main-Is: Main.hs
     Build-Depends: base       >= 4   && < 5,
                    array      >= 0.1 && < 0.6,
-                   bytestring >= 0.9 && < 0.11,
+                   bytestring >= 0.9 && < 0.12,
                    directory  >= 1   && < 1.4,
                    process    >= 1   && < 1.7,
                    filepath   >= 1   && < 1.5,
diff --git a/libraries/Cabal b/libraries/Cabal
index 23ca3cb318418aaf4aafd3db862278a12a794a26..997930e0d6c6c5a8ceadd91d4f5e21751098a1bb 160000
--- a/libraries/Cabal
+++ b/libraries/Cabal
@@ -1 +1 @@
-Subproject commit 23ca3cb318418aaf4aafd3db862278a12a794a26
+Subproject commit 997930e0d6c6c5a8ceadd91d4f5e21751098a1bb
diff --git a/libraries/bytestring b/libraries/bytestring
index da9d8d80f3bdb440cf4fbba65c08e289f58535a1..310cdb90c925c35f962df9c690bd35e20136da26 160000
--- a/libraries/bytestring
+++ b/libraries/bytestring
@@ -1 +1 @@
-Subproject commit da9d8d80f3bdb440cf4fbba65c08e289f58535a1
+Subproject commit 310cdb90c925c35f962df9c690bd35e20136da26
diff --git a/libraries/ghc-boot/ghc-boot.cabal.in b/libraries/ghc-boot/ghc-boot.cabal.in
index eb6ec3bd7651011a4d1ca59f992d5261f14c5180..37a59be090331fbcd0f2419f7751a97ddfd43a40 100644
--- a/libraries/ghc-boot/ghc-boot.cabal.in
+++ b/libraries/ghc-boot/ghc-boot.cabal.in
@@ -67,7 +67,7 @@ Library
 
     build-depends: base       >= 4.7 && < 4.17,
                    binary     == 0.8.*,
-                   bytestring == 0.10.*,
+                   bytestring >= 0.10 && < 0.12,
                    containers >= 0.5 && < 0.7,
                    directory  >= 1.2 && < 1.4,
                    filepath   >= 1.3 && < 1.5,
diff --git a/libraries/ghci/ghci.cabal.in b/libraries/ghci/ghci.cabal.in
index 1674a71dd6bb30359e845dca5432ed9b87196b7a..d2db85c76b19954969ec4c7edb323372027d66b3 100644
--- a/libraries/ghci/ghci.cabal.in
+++ b/libraries/ghci/ghci.cabal.in
@@ -74,7 +74,7 @@ library
         base             >= 4.8 && < 4.17,
         ghc-prim         >= 0.5.0 && < 0.9,
         binary           == 0.8.*,
-        bytestring       == 0.10.*,
+        bytestring       >= 0.10 && < 0.12,
         containers       >= 0.5 && < 0.7,
         deepseq          == 1.4.*,
         filepath         == 1.4.*,
diff --git a/libraries/haskeline b/libraries/haskeline
index 28ee26ad5b4ae1c0584f2ec11ac53be9671bf878..7d8d1abd6878ad14583ac476b664d5c3edf2f339 160000
--- a/libraries/haskeline
+++ b/libraries/haskeline
@@ -1 +1 @@
-Subproject commit 28ee26ad5b4ae1c0584f2ec11ac53be9671bf878
+Subproject commit 7d8d1abd6878ad14583ac476b664d5c3edf2f339
diff --git a/libraries/libiserv/libiserv.cabal.in b/libraries/libiserv/libiserv.cabal.in
index 3721a853cc5bac78481153e000823bb79e29b86e..c8cdf33a8ae1b53e22ac1a59b084d998261ba185 100644
--- a/libraries/libiserv/libiserv.cabal.in
+++ b/libraries/libiserv/libiserv.cabal.in
@@ -26,7 +26,7 @@ Library
                    , GHCi.Utils
     Build-Depends: base       >= 4   && < 5,
                    binary     >= 0.7 && < 0.11,
-                   bytestring >= 0.10 && < 0.11,
+                   bytestring >= 0.10 && < 0.12,
                    containers >= 0.5 && < 0.7,
                    deepseq    >= 1.4 && < 1.5,
                    ghci       == @ProjectVersionMunged@
diff --git a/libraries/parsec b/libraries/parsec
index 905bc2e3e1c374934d49e16dc5b7c49bf2c3c815..38dfc545874dd44c26382d8dd692eb533396c6f5 160000
--- a/libraries/parsec
+++ b/libraries/parsec
@@ -1 +1 @@
-Subproject commit 905bc2e3e1c374934d49e16dc5b7c49bf2c3c815
+Subproject commit 38dfc545874dd44c26382d8dd692eb533396c6f5
diff --git a/libraries/text b/libraries/text
index 3ed977de30e9fb74af33ce9ea4efa4a284c17bdb..853471cc714922a9f914342fa0bb9ef10e5b4158 160000
--- a/libraries/text
+++ b/libraries/text
@@ -1 +1 @@
-Subproject commit 3ed977de30e9fb74af33ce9ea4efa4a284c17bdb
+Subproject commit 853471cc714922a9f914342fa0bb9ef10e5b4158
diff --git a/libraries/unix b/libraries/unix
index e079823775066bcab56b22842be6cce6e060fb9f..21437f20a41eb1a4c7d42fc402fe91350eb8b03d 160000
--- a/libraries/unix
+++ b/libraries/unix
@@ -1 +1 @@
-Subproject commit e079823775066bcab56b22842be6cce6e060fb9f
+Subproject commit 21437f20a41eb1a4c7d42fc402fe91350eb8b03d
diff --git a/testsuite/tests/ghci/scripts/T9881.stdout b/testsuite/tests/ghci/scripts/T9881.stdout
index 57bc6256d30173db3d5ef2ec93fefd305b55a76d..45e3de396ae66f0b1b7260bca396a99d74a8b4c0 100644
--- a/testsuite/tests/ghci/scripts/T9881.stdout
+++ b/testsuite/tests/ghci/scripts/T9881.stdout
@@ -19,10 +19,9 @@ instance Read Data.ByteString.Lazy.ByteString
 
 type Data.ByteString.ByteString :: *
 data Data.ByteString.ByteString
-  = Data.ByteString.Internal.PS {-# UNPACK #-}(GHC.ForeignPtr.ForeignPtr
+  = Data.ByteString.Internal.BS {-# UNPACK #-}(GHC.ForeignPtr.ForeignPtr
                                                  GHC.Word.Word8)
                                 {-# UNPACK #-}Int
-                                {-# UNPACK #-}Int
   	-- Defined in ‘Data.ByteString.Internal’
 instance Eq Data.ByteString.ByteString
   -- Defined in ‘Data.ByteString.Internal’
diff --git a/testsuite/tests/perf/should_run/T4978.hs b/testsuite/tests/perf/should_run/T4978.hs
index 9324b72be0f55a8c731ab43e938a7b4d6826b691..e5573def6f910ee8960c784114ddde4673f70ece 100644
--- a/testsuite/tests/perf/should_run/T4978.hs
+++ b/testsuite/tests/perf/should_run/T4978.hs
@@ -2,7 +2,6 @@ module Main (main) where
 
 import qualified Data.ByteString as S
 import qualified Data.ByteString.Lazy as L
-import Data.ByteString.Internal (inlinePerformIO)
 import qualified Data.ByteString.Internal as S
 import Data.Semigroup
 import Data.Monoid
@@ -66,7 +65,7 @@ defaultSize = 32 * k - overhead
 
 -- | Sequence an IO operation on the buffer
 unsafeLiftIO :: (Buffer -> IO Buffer) -> Builder
-unsafeLiftIO f =  Builder $ \ k buf -> inlinePerformIO $ do
+unsafeLiftIO f =  Builder $ \ k buf -> unsafePerformIO $ do
     buf' <- f buf
     return (k buf')
 {-# INLINE unsafeLiftIO #-}
diff --git a/testsuite/tests/profiling/should_run/T3001-2.hs b/testsuite/tests/profiling/should_run/T3001-2.hs
index c7340dfd190d22959755b5fb16e6331c5de732f4..3767073cc3412ff154f20ee4e88e2ae614f9d1c7 100644
--- a/testsuite/tests/profiling/should_run/T3001-2.hs
+++ b/testsuite/tests/profiling/should_run/T3001-2.hs
@@ -3,20 +3,19 @@
 -- GHC 6.10.1 and run with +RTS -hb. Most of the code is from the
 -- binary 0.4.4 package.
 
-{-# LANGUAGE CPP, FlexibleInstances, FlexibleContexts, MagicHash #-}
+{-# LANGUAGE CPP, FlexibleInstances, FlexibleContexts, MagicHash, UnboxedTuples #-}
 
 module Main (main) where
 
 import Data.Semigroup
 
-import Data.ByteString.Internal (inlinePerformIO)
-
 import qualified Data.ByteString      as S
 import qualified Data.ByteString.Internal      as S
 import qualified Data.ByteString.Lazy as L
 import qualified Data.ByteString.Lazy.Internal as L
 
 import GHC.Exts
+import GHC.IO
 import GHC.Word
 
 import Control.Monad
@@ -28,6 +27,11 @@ import Data.Char    (chr,ord)
 
 import Control.Applicative
 
+inlinePerformIO :: IO a -> a
+inlinePerformIO (IO m) = case m realWorld# of
+  (# _, r #) -> r
+{-# INLINE inlinePerformIO #-}
+
 main :: IO ()
 main = do
   encodeFile "test.bin" $ replicate 10000 'x'
@@ -158,7 +162,7 @@ shiftl_w32 (W32# w) (I# i) = W32# (wordToWord32# ((word32ToWord# w) `uncheckedSh
 getPtr :: Storable a => Int -> Get a
 getPtr n = do
     (fp,o,_) <- readN n S.toForeignPtr
-    return . S.inlinePerformIO $ withForeignPtr fp $ \p -> peek (castPtr $ p `plusPtr` o)
+    return . inlinePerformIO $ withForeignPtr fp $ \p -> peek (castPtr $ p `plusPtr` o)
 
 getBytes :: Int -> Get S.ByteString
 getBytes n = do
diff --git a/utils/ghc-cabal/ghc-cabal.cabal b/utils/ghc-cabal/ghc-cabal.cabal
index e00a812f3212c59f81dc8993b93f5babfc68f6c8..4ad88ead3ca9bdd0378cc4d0ca9a207a58e26e17 100644
--- a/utils/ghc-cabal/ghc-cabal.cabal
+++ b/utils/ghc-cabal/ghc-cabal.cabal
@@ -20,7 +20,7 @@ Executable ghc-cabal
     Main-Is: Main.hs
 
     Build-Depends: base       >= 3   && < 5,
-                   bytestring >= 0.10 && < 0.11,
+                   bytestring >= 0.10 && < 0.12,
                    Cabal      >= 3.2 && < 3.6,
                    directory  >= 1.1 && < 1.4,
                    filepath   >= 1.2 && < 1.5
diff --git a/utils/ghc-cabal/ghc.mk b/utils/ghc-cabal/ghc.mk
index e9647a2af1715c16f3a2965f2c62b9c9272b7951..76b083684f7d84cd1a2ac628e28e765636766928 100644
--- a/utils/ghc-cabal/ghc.mk
+++ b/utils/ghc-cabal/ghc.mk
@@ -76,7 +76,7 @@ $(ghc-cabal_DIST_BINARY): $(CABAL_LEXER_DEP) utils/ghc-cabal/Main.hs $(TOUCH_DEP
 	       -ilibraries/filepath \
 	       -ilibraries/hpc \
 	       -ilibraries/mtl \
-	       -ilibraries/text \
+	       -ilibraries/text/src \
 	       libraries/text/cbits/cbits.c \
 	       -Ilibraries/text/include \
 	       -ilibraries/parsec/src \
diff --git a/utils/iserv/iserv.cabal.in b/utils/iserv/iserv.cabal.in
index 356c8a444a3982baa694cb90cc03c988341bcb61..46a0357a63e60d702f93261e88395d5665efb64f 100644
--- a/utils/iserv/iserv.cabal.in
+++ b/utils/iserv/iserv.cabal.in
@@ -36,7 +36,7 @@ Executable iserv
     Build-Depends: array      >= 0.5 && < 0.6,
                    base       >= 4   && < 5,
                    binary     >= 0.7 && < 0.11,
-                   bytestring >= 0.10 && < 0.11,
+                   bytestring >= 0.10 && < 0.12,
                    containers >= 0.5 && < 0.7,
                    deepseq    >= 1.4 && < 1.5,
                    ghci       == @ProjectVersionMunged@,