We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[package] libunwind/1.3.1 library dependency order is wrong
### Package and Environment Details (include every applicable attribute)
  * Package Name/Version: **libunwind/1.3.1**
  * Operating System+version: **Linux Ubuntu 18.04**
  * Compiler+version: **GCC 7**
  * Conan version: **conan 1.21.1**
  * Python version: **Python 2.7.17, 3.6.9**


### Conan profile (output of `conan profile show default` or `conan profile show <profile>` if custom profile is in use)
```
[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=7
compiler.libcxx=libstdc++1+
[options]
[build_requires]
[env]
```

But **error occurs when static linking**, that is shared=False.

### Steps to reproduce (Include if Applicable)

Soon I will write an example to reproduce.

But there is [an example about libunwind library dependency](https://github.com/daniel-thompson/libunwind-examples/blob/master/Makefile)

* current order : `unwind` `unwind-generic` `unwind-ptrace`
* right order : `unwind-ptrace` `unwind-generic` `unwind`

### Logs (Include/Attach if Applicable)
<details><summary>Click to expand log</summary>

```
Put your log output here
```

</details>


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `recipes/libunwind/all/conanfile.py`
Content:
```
1 from conans import ConanFile, AutoToolsBuildEnvironment, tools
2 from conans.errors import ConanInvalidConfiguration
3 import os
4 import glob
5 
6 
7 class LiunwindConan(ConanFile):
8     name = "libunwind"
9     description = "Manipulate the preserved state of each call-frame and resume the execution at any point."
10     topics = ("conan", "libunwind", "unwind", "debuggers", "exception-handling", "introspection", "setjmp")
11     url = "https://github.com/conan-io/conan-center-index"
12     homepage = "https://github.com/libunwind/libunwind"
13     license = "MIT"
14     settings = "os", "arch", "compiler", "build_type"
15     options = {"shared": [True, False], "fPIC": [True, False], "coredump": [True, False], "ptrace": [True, False], "setjmp": [True, False]}
16     default_options = {"shared": False, "fPIC": True, "coredump": True, "ptrace": True, "setjmp": True}
17     requires = "xz_utils/5.2.4"
18     _autotools = None
19 
20     @property
21     def _source_subfolder(self):
22         return "source_subfolder"
23 
24     def configure(self):
25         if self.settings.os not in ["Linux", "FreeBSD"]:
26             raise ConanInvalidConfiguration("libunwind is only supported on Linux and FreeBSD")
27         del self.settings.compiler.libcxx
28         del self.settings.compiler.cppstd
29 
30     def source(self):
31         tools.get(**self.conan_data["sources"][self.version])
32         extracted_dir = self.name + "-" + self.version
33         os.rename(extracted_dir, self._source_subfolder)
34 
35     def _configure_autotools(self):
36         if not self._autotools:
37             self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows)
38             args = [
39                 "--enable-shared={}".format("yes" if self.options.shared else "no"),
40                 "--enable-static={}".format("no" if self.options.shared else "yes"),
41                 "--enable-coredump={}".format("yes" if self.options.coredump else "no"),
42                 "--enable-ptrace={}".format("yes" if self.options.ptrace else "no"),
43                 "--enable-setjmp={}".format("yes" if self.options.setjmp else "no"),
44                 "--disable-tests",
45                 "--disable-documentation"
46             ]
47             self._autotools.configure(configure_dir=self._source_subfolder, args=args)
48         return self._autotools
49 
50     def build(self):
51         autotools = self._configure_autotools()
52         autotools.make()
53 
54     def package(self):
55         self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder)
56         autotools = self._configure_autotools()
57         autotools.install()
58         tools.rmdir(os.path.join(self.package_folder, 'lib', 'pkgconfig'))
59         with tools.chdir(os.path.join(self.package_folder, "lib")):
60             for filename in glob.glob("*.la"):
61                 os.unlink(filename)
62 
63     def package_info(self):
64         self.cpp_info.libs = tools.collect_libs(self)
65         if self.settings.os == "Linux":
66             self.cpp_info.system_libs.append("pthread")
67
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/recipes/libunwind/all/conanfile.py b/recipes/libunwind/all/conanfile.py
--- a/recipes/libunwind/all/conanfile.py
+++ b/recipes/libunwind/all/conanfile.py
@@ -24,6 +24,8 @@
     def configure(self):
         if self.settings.os not in ["Linux", "FreeBSD"]:
             raise ConanInvalidConfiguration("libunwind is only supported on Linux and FreeBSD")
+        if self.options.shared:
+            del self.options.fPIC
         del self.settings.compiler.libcxx
         del self.settings.compiler.cppstd
 
@@ -61,6 +63,23 @@
                 os.unlink(filename)
 
     def package_info(self):
-        self.cpp_info.libs = tools.collect_libs(self)
+        self.cpp_info.components["unwind"].names["pkg_config"] = "libunwind"
+        self.cpp_info.components["unwind"].libs = ["unwind"]
+        self.cpp_info.components["unwind"].requires = ["xz_utils::xz_utils"]
         if self.settings.os == "Linux":
-            self.cpp_info.system_libs.append("pthread")
+            self.cpp_info.components["unwind"].system_libs.append("pthread")
+        self.cpp_info.components["generic"].names["pkg_config"] = "libunwind-generic"
+        self.cpp_info.components["generic"].libs = ["unwind-generic"]
+        self.cpp_info.components["generic"].requires = ["unwind"]
+        if self.options.ptrace:
+            self.cpp_info.components["ptrace"].names["pkg_config"] = "libunwind-ptrace"
+            self.cpp_info.components["ptrace"].libs = ["unwind-ptrace"]
+            self.cpp_info.components["ptrace"].requires = ["generic", "unwind"]
+        if self.options.setjmp:
+            self.cpp_info.components["setjmp"].names["pkg_config"] = "libunwind-setjmp"
+            self.cpp_info.components["setjmp"].libs = ["unwind-setjmp"]
+            self.cpp_info.components["setjmp"].requires = ["unwind"]
+        if self.options.coredump:
+            self.cpp_info.components["coredump"].names["pkg_config"] = "libunwind-coredump"
+            self.cpp_info.components["coredump"].libs = ["unwind-coredump"]
+            self.cpp_info.components["coredump"].requires = ["generic", "unwind"]

{"golden_diff": "diff --git a/recipes/libunwind/all/conanfile.py b/recipes/libunwind/all/conanfile.py\n--- a/recipes/libunwind/all/conanfile.py\n+++ b/recipes/libunwind/all/conanfile.py\n@@ -24,6 +24,8 @@\n     def configure(self):\n         if self.settings.os not in [\"Linux\", \"FreeBSD\"]:\n             raise ConanInvalidConfiguration(\"libunwind is only supported on Linux and FreeBSD\")\n+        if self.options.shared:\n+            del self.options.fPIC\n         del self.settings.compiler.libcxx\n         del self.settings.compiler.cppstd\n \n@@ -61,6 +63,23 @@\n                 os.unlink(filename)\n \n     def package_info(self):\n-        self.cpp_info.libs = tools.collect_libs(self)\n+        self.cpp_info.components[\"unwind\"].names[\"pkg_config\"] = \"libunwind\"\n+        self.cpp_info.components[\"unwind\"].libs = [\"unwind\"]\n+        self.cpp_info.components[\"unwind\"].requires = [\"xz_utils::xz_utils\"]\n         if self.settings.os == \"Linux\":\n-            self.cpp_info.system_libs.append(\"pthread\")\n+            self.cpp_info.components[\"unwind\"].system_libs.append(\"pthread\")\n+        self.cpp_info.components[\"generic\"].names[\"pkg_config\"] = \"libunwind-generic\"\n+        self.cpp_info.components[\"generic\"].libs = [\"unwind-generic\"]\n+        self.cpp_info.components[\"generic\"].requires = [\"unwind\"]\n+        if self.options.ptrace:\n+            self.cpp_info.components[\"ptrace\"].names[\"pkg_config\"] = \"libunwind-ptrace\"\n+            self.cpp_info.components[\"ptrace\"].libs = [\"unwind-ptrace\"]\n+            self.cpp_info.components[\"ptrace\"].requires = [\"generic\", \"unwind\"]\n+        if self.options.setjmp:\n+            self.cpp_info.components[\"setjmp\"].names[\"pkg_config\"] = \"libunwind-setjmp\"\n+            self.cpp_info.components[\"setjmp\"].libs = [\"unwind-setjmp\"]\n+            self.cpp_info.components[\"setjmp\"].requires = [\"unwind\"]\n+        if self.options.coredump:\n+            self.cpp_info.components[\"coredump\"].names[\"pkg_config\"] = \"libunwind-coredump\"\n+            self.cpp_info.components[\"coredump\"].libs = [\"unwind-coredump\"]\n+            self.cpp_info.components[\"coredump\"].requires = [\"generic\", \"unwind\"]\n", "issue": "[package] libunwind/1.3.1 library dependency order is wrong\n### Package and Environment Details (include every applicable attribute)\r\n  * Package Name/Version: **libunwind/1.3.1**\r\n  * Operating System+version: **Linux Ubuntu 18.04**\r\n  * Compiler+version: **GCC 7**\r\n  * Conan version: **conan 1.21.1**\r\n  * Python version: **Python 2.7.17, 3.6.9**\r\n\r\n\r\n### Conan profile (output of `conan profile show default` or `conan profile show <profile>` if custom profile is in use)\r\n```\r\n[settings]\r\nos=Linux\r\nos_build=Linux\r\narch=x86_64\r\narch_build=x86_64\r\ncompiler=gcc\r\ncompiler.version=7\r\ncompiler.libcxx=libstdc++1+\r\n[options]\r\n[build_requires]\r\n[env]\r\n```\r\n\r\nBut **error occurs when static linking**, that is shared=False.\r\n\r\n### Steps to reproduce (Include if Applicable)\r\n\r\nSoon I will write an example to reproduce.\r\n\r\nBut there is [an example about libunwind library dependency](https://github.com/daniel-thompson/libunwind-examples/blob/master/Makefile)\r\n\r\n* current order : `unwind` `unwind-generic` `unwind-ptrace`\r\n* right order : `unwind-ptrace` `unwind-generic` `unwind`\r\n\r\n### Logs (Include/Attach if Applicable)\r\n<details><summary>Click to expand log</summary>\r\n\r\n```\r\nPut your log output here\r\n```\r\n\r\n</details>\r\n\n", "before_files": [{"content": "from conans import ConanFile, AutoToolsBuildEnvironment, tools\nfrom conans.errors import ConanInvalidConfiguration\nimport os\nimport glob\n\n\nclass LiunwindConan(ConanFile):\n    name = \"libunwind\"\n    description = \"Manipulate the preserved state of each call-frame and resume the execution at any point.\"\n    topics = (\"conan\", \"libunwind\", \"unwind\", \"debuggers\", \"exception-handling\", \"introspection\", \"setjmp\")\n    url = \"https://github.com/conan-io/conan-center-index\"\n    homepage = \"https://github.com/libunwind/libunwind\"\n    license = \"MIT\"\n    settings = \"os\", \"arch\", \"compiler\", \"build_type\"\n    options = {\"shared\": [True, False], \"fPIC\": [True, False], \"coredump\": [True, False], \"ptrace\": [True, False], \"setjmp\": [True, False]}\n    default_options = {\"shared\": False, \"fPIC\": True, \"coredump\": True, \"ptrace\": True, \"setjmp\": True}\n    requires = \"xz_utils/5.2.4\"\n    _autotools = None\n\n    @property\n    def _source_subfolder(self):\n        return \"source_subfolder\"\n\n    def configure(self):\n        if self.settings.os not in [\"Linux\", \"FreeBSD\"]:\n            raise ConanInvalidConfiguration(\"libunwind is only supported on Linux and FreeBSD\")\n        del self.settings.compiler.libcxx\n        del self.settings.compiler.cppstd\n\n    def source(self):\n        tools.get(**self.conan_data[\"sources\"][self.version])\n        extracted_dir = self.name + \"-\" + self.version\n        os.rename(extracted_dir, self._source_subfolder)\n\n    def _configure_autotools(self):\n        if not self._autotools:\n            self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows)\n            args = [\n                \"--enable-shared={}\".format(\"yes\" if self.options.shared else \"no\"),\n                \"--enable-static={}\".format(\"no\" if self.options.shared else \"yes\"),\n                \"--enable-coredump={}\".format(\"yes\" if self.options.coredump else \"no\"),\n                \"--enable-ptrace={}\".format(\"yes\" if self.options.ptrace else \"no\"),\n                \"--enable-setjmp={}\".format(\"yes\" if self.options.setjmp else \"no\"),\n                \"--disable-tests\",\n                \"--disable-documentation\"\n            ]\n            self._autotools.configure(configure_dir=self._source_subfolder, args=args)\n        return self._autotools\n\n    def build(self):\n        autotools = self._configure_autotools()\n        autotools.make()\n\n    def package(self):\n        self.copy(pattern=\"COPYING\", dst=\"licenses\", src=self._source_subfolder)\n        autotools = self._configure_autotools()\n        autotools.install()\n        tools.rmdir(os.path.join(self.package_folder, 'lib', 'pkgconfig'))\n        with tools.chdir(os.path.join(self.package_folder, \"lib\")):\n            for filename in glob.glob(\"*.la\"):\n                os.unlink(filename)\n\n    def package_info(self):\n        self.cpp_info.libs = tools.collect_libs(self)\n        if self.settings.os == \"Linux\":\n            self.cpp_info.system_libs.append(\"pthread\")\n", "path": "recipes/libunwind/all/conanfile.py"}], "after_files": [{"content": "from conans import ConanFile, AutoToolsBuildEnvironment, tools\nfrom conans.errors import ConanInvalidConfiguration\nimport os\nimport glob\n\n\nclass LiunwindConan(ConanFile):\n    name = \"libunwind\"\n    description = \"Manipulate the preserved state of each call-frame and resume the execution at any point.\"\n    topics = (\"conan\", \"libunwind\", \"unwind\", \"debuggers\", \"exception-handling\", \"introspection\", \"setjmp\")\n    url = \"https://github.com/conan-io/conan-center-index\"\n    homepage = \"https://github.com/libunwind/libunwind\"\n    license = \"MIT\"\n    settings = \"os\", \"arch\", \"compiler\", \"build_type\"\n    options = {\"shared\": [True, False], \"fPIC\": [True, False], \"coredump\": [True, False], \"ptrace\": [True, False], \"setjmp\": [True, False]}\n    default_options = {\"shared\": False, \"fPIC\": True, \"coredump\": True, \"ptrace\": True, \"setjmp\": True}\n    requires = \"xz_utils/5.2.4\"\n    _autotools = None\n\n    @property\n    def _source_subfolder(self):\n        return \"source_subfolder\"\n\n    def configure(self):\n        if self.settings.os not in [\"Linux\", \"FreeBSD\"]:\n            raise ConanInvalidConfiguration(\"libunwind is only supported on Linux and FreeBSD\")\n        if self.options.shared:\n            del self.options.fPIC\n        del self.settings.compiler.libcxx\n        del self.settings.compiler.cppstd\n\n    def source(self):\n        tools.get(**self.conan_data[\"sources\"][self.version])\n        extracted_dir = self.name + \"-\" + self.version\n        os.rename(extracted_dir, self._source_subfolder)\n\n    def _configure_autotools(self):\n        if not self._autotools:\n            self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows)\n            args = [\n                \"--enable-shared={}\".format(\"yes\" if self.options.shared else \"no\"),\n                \"--enable-static={}\".format(\"no\" if self.options.shared else \"yes\"),\n                \"--enable-coredump={}\".format(\"yes\" if self.options.coredump else \"no\"),\n                \"--enable-ptrace={}\".format(\"yes\" if self.options.ptrace else \"no\"),\n                \"--enable-setjmp={}\".format(\"yes\" if self.options.setjmp else \"no\"),\n                \"--disable-tests\",\n                \"--disable-documentation\"\n            ]\n            self._autotools.configure(configure_dir=self._source_subfolder, args=args)\n        return self._autotools\n\n    def build(self):\n        autotools = self._configure_autotools()\n        autotools.make()\n\n    def package(self):\n        self.copy(pattern=\"COPYING\", dst=\"licenses\", src=self._source_subfolder)\n        autotools = self._configure_autotools()\n        autotools.install()\n        tools.rmdir(os.path.join(self.package_folder, 'lib', 'pkgconfig'))\n        with tools.chdir(os.path.join(self.package_folder, \"lib\")):\n            for filename in glob.glob(\"*.la\"):\n                os.unlink(filename)\n\n    def package_info(self):\n        self.cpp_info.components[\"unwind\"].names[\"pkg_config\"] = \"libunwind\"\n        self.cpp_info.components[\"unwind\"].libs = [\"unwind\"]\n        self.cpp_info.components[\"unwind\"].requires = [\"xz_utils::xz_utils\"]\n        if self.settings.os == \"Linux\":\n            self.cpp_info.components[\"unwind\"].system_libs.append(\"pthread\")\n        self.cpp_info.components[\"generic\"].names[\"pkg_config\"] = \"libunwind-generic\"\n        self.cpp_info.components[\"generic\"].libs = [\"unwind-generic\"]\n        self.cpp_info.components[\"generic\"].requires = [\"unwind\"]\n        if self.options.ptrace:\n            self.cpp_info.components[\"ptrace\"].names[\"pkg_config\"] = \"libunwind-ptrace\"\n            self.cpp_info.components[\"ptrace\"].libs = [\"unwind-ptrace\"]\n            self.cpp_info.components[\"ptrace\"].requires = [\"generic\", \"unwind\"]\n        if self.options.setjmp:\n            self.cpp_info.components[\"setjmp\"].names[\"pkg_config\"] = \"libunwind-setjmp\"\n            self.cpp_info.components[\"setjmp\"].libs = [\"unwind-setjmp\"]\n            self.cpp_info.components[\"setjmp\"].requires = [\"unwind\"]\n        if self.options.coredump:\n            self.cpp_info.components[\"coredump\"].names[\"pkg_config\"] = \"libunwind-coredump\"\n            self.cpp_info.components[\"coredump\"].libs = [\"unwind-coredump\"]\n            self.cpp_info.components[\"coredump\"].requires = [\"generic\", \"unwind\"]\n", "path": "recipes/libunwind/all/conanfile.py"}]}