diff --git a/bitbake/lib/bb/cookerdata.py b/bitbake/lib/bb/cookerdata.py
index 0649e40995..823da5f4c4 100644
--- a/bitbake/lib/bb/cookerdata.py
+++ b/bitbake/lib/bb/cookerdata.py
@@ -370,6 +370,20 @@ class CookerDataBuilder(object):
             data = bb.data.createCopy(data)
             approved = bb.utils.approved_variables()
 
+            # Resolve symlinks in layer paths so that layers referenced
+            # via different paths (e.g. symlinks) are not treated as
+            # duplicates (see Bug 15591)
+            resolved_layers = []
+            seen_real = set()
+            for layer in layers:
+                real = os.path.realpath(layer)
+                if real not in seen_real:
+                    seen_real.add(real)
+                    resolved_layers.append(layer)
+                else:
+                    parselog.warning("Ignoring duplicate layer entry %s (resolves to %s which is already in BBLAYERS)", layer, real)
+            layers = resolved_layers
+
             # Check whether present layer directories exist
             for layer in layers:
                 if not os.path.isdir(layer):
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index 1b4fb93a30..1972c9864a 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -1441,6 +1441,9 @@ def edit_bblayers_conf(bblayers_conf, add, remove, edit_cb=None):
         pth = remove_trailing_sep(pth)
         if 'HOME' in approved and '~' in pth:
             pth = os.path.expanduser(pth)
+        # Resolve symlinks for real paths, but not for glob patterns
+        if '*' not in pth and '?' not in pth:
+            pth = os.path.realpath(pth)
         return pth
 
     def layerlist_param(value):
diff --git a/bitbake/lib/bblayers/action.py b/bitbake/lib/bblayers/action.py
index a8f2699335..11cca74eb3 100644
--- a/bitbake/lib/bblayers/action.py
+++ b/bitbake/lib/bblayers/action.py
@@ -26,7 +26,7 @@ def plugin_init(plugins):
 class ActionPlugin(LayerPlugin):
     def do_add_layer(self, args):
         """Add one or more layers to bblayers.conf."""
-        layerdirs = [os.path.abspath(ldir) for ldir in args.layerdir]
+        layerdirs = [os.path.realpath(ldir) for ldir in args.layerdir]
 
         for layerdir in layerdirs:
             if not os.path.exists(layerdir):
