diff options
Diffstat (limited to 'meta/recipes-core/eglibc/eglibc-2.18/0002-eglibc-menuconfig-hex-string-options.patch')
-rw-r--r-- | meta/recipes-core/eglibc/eglibc-2.18/0002-eglibc-menuconfig-hex-string-options.patch | 169 |
1 files changed, 169 insertions, 0 deletions
diff --git a/meta/recipes-core/eglibc/eglibc-2.18/0002-eglibc-menuconfig-hex-string-options.patch b/meta/recipes-core/eglibc/eglibc-2.18/0002-eglibc-menuconfig-hex-string-options.patch new file mode 100644 index 0000000000..7caba48112 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.18/0002-eglibc-menuconfig-hex-string-options.patch | |||
@@ -0,0 +1,169 @@ | |||
1 | pulled from | ||
2 | |||
3 | http://www.eglibc.org/archives/patches/msg01043.html | ||
4 | |||
5 | |||
6 | Upstream-Status: Pending | ||
7 | Signed-off-by: Khem | ||
8 | |||
9 | |||
10 | This patch builds on the menuconfig patch for EGLIBC. | ||
11 | |||
12 | |||
13 | There are a few options that have non-boolean types, that would benefit from the new 'make *config' support: | ||
14 | |||
15 | EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE (int) | ||
16 | EGLIBC_NSSWITCH_FIXED_CONFIG (string) | ||
17 | EGLIBC_NSSWITCH_FIXED_FUNCTIONS (string) | ||
18 | |||
19 | |||
20 | The patch converts these to real options in libc/option-groups.def. Also, libc/scripts/option-groups.awk is modified to output a '#define' line for int, hex, or string options encountered in the config file. | ||
21 | |||
22 | In the post-processing script config-postproc.pl, a small change is needed: for any boolean option FOO that is implicitly disabled in the kconfig output, make sure that option is indeed a boolean before printing the explicit OPTION_FOO=n. | ||
23 | |||
24 | Finally, libc/malloc/Makefile passes __OPTION_EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE as a CPPFLAGS, which is not necessary anymore because this macro will now be present in the generated header. | ||
25 | |||
26 | attached is the updated patch to address above issues. | ||
27 | |||
28 | Steve | ||
29 | |||
30 | -- | ||
31 | Steve Longerbeam | Senior Embedded Engineer, ESD Services | ||
32 | Mentor Embedded(tm) | 46871 Bayside Parkway, Fremont, CA 94538 | ||
33 | P 510.354.5838 | M 408.410.2735 | ||
34 | Nucleus(r) | Linux(r) | Android(tm) | Services | UI | Multi-OS | ||
35 | |||
36 | |||
37 | Index: libc/malloc/Makefile | ||
38 | =================================================================== | ||
39 | --- libc.orig/malloc/Makefile 2012-01-04 22:06:18.000000000 -0800 | ||
40 | +++ libc/malloc/Makefile 2012-05-09 19:35:28.598682105 -0700 | ||
41 | @@ -48,10 +48,6 @@ | ||
42 | ifeq ($(OPTION_EGLIBC_MEMUSAGE),y) | ||
43 | extra-libs = libmemusage | ||
44 | extra-libs-others = $(extra-libs) | ||
45 | - | ||
46 | -ifdef OPTION_EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE | ||
47 | -CPPFLAGS-memusage += -D__OPTION_EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE=$(OPTION_EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE) | ||
48 | -endif | ||
49 | endif | ||
50 | |||
51 | libmemusage-routines = memusage | ||
52 | Index: libc/option-groups.def | ||
53 | =================================================================== | ||
54 | --- libc.orig/option-groups.def 2012-05-09 19:33:48.398677256 -0700 | ||
55 | +++ libc/option-groups.def 2012-05-09 19:35:28.610682107 -0700 | ||
56 | @@ -513,8 +513,11 @@ | ||
57 | the `memusage' and `memusagestat' utilities. | ||
58 | These components provide memory profiling functions. | ||
59 | |||
60 | - EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE | ||
61 | - | ||
62 | +config EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE | ||
63 | + int "Memory profiling library buffer size" | ||
64 | + depends on EGLIBC_MEMUSAGE | ||
65 | + default "32768" | ||
66 | + help | ||
67 | Libmemusage library buffers the profiling data in memory | ||
68 | before writing it out to disk. By default, the library | ||
69 | allocates 1.5M buffer, which can be substantial for some | ||
70 | @@ -553,8 +556,11 @@ | ||
71 | 'option-groups.config' file must set the following two | ||
72 | variables: | ||
73 | |||
74 | - EGLIBC_NSSWITCH_FIXED_CONFIG | ||
75 | - | ||
76 | +config EGLIBC_NSSWITCH_FIXED_CONFIG | ||
77 | + string "Nsswitch fixed config filename" | ||
78 | + depends on !EGLIBC_NSSWITCH | ||
79 | + default "" | ||
80 | + help | ||
81 | Set this to the name of a file whose contents observe the | ||
82 | same syntax as an ordinary '/etc/nsswitch.conf' file. The | ||
83 | EGLIBC build process parses this file just as EGLIBC would | ||
84 | @@ -576,8 +582,11 @@ | ||
85 | you will probably want to delete references to databases not | ||
86 | needed on your system. | ||
87 | |||
88 | - EGLIBC_NSSWITCH_FIXED_FUNCTIONS | ||
89 | - | ||
90 | +config EGLIBC_NSSWITCH_FIXED_FUNCTIONS | ||
91 | + string "Nsswitch fixed functions filename" | ||
92 | + depends on !EGLIBC_NSSWITCH | ||
93 | + default "" | ||
94 | + help | ||
95 | The EGLIBC build process uses this file to decide which | ||
96 | functions to make available from which service libraries. | ||
97 | The file 'nss/fixed-nsswitch.functions' serves as a sample | ||
98 | Index: libc/options-config/config-postproc.pl | ||
99 | =================================================================== | ||
100 | --- libc.orig/options-config/config-postproc.pl 2012-05-09 19:33:36.530676681 -0700 | ||
101 | +++ libc/options-config/config-postproc.pl 2012-05-09 19:35:28.610682107 -0700 | ||
102 | @@ -8,7 +8,7 @@ | ||
103 | die "Could not open $ARGV[0]" unless -T $ARGV[0]; | ||
104 | |||
105 | sub yank { | ||
106 | - @option = grep($_ ne $_[0], @option); | ||
107 | + @option = grep(!($_ =~ /$_[0]\s*=/), @option); | ||
108 | } | ||
109 | |||
110 | open(DEFAULTS, $defaults) || die "Could not open $defaults\n"; | ||
111 | @@ -16,7 +16,7 @@ | ||
112 | # get the full list of available options using the default config file | ||
113 | $i = 0; | ||
114 | while (<DEFAULTS>) { | ||
115 | - if (/^\s*OPTION_(\w+)\s*=/) { | ||
116 | + if (/^\s*OPTION_(\w+\s*=.*$)/) { | ||
117 | $option[$i++] = $1; | ||
118 | } | ||
119 | } | ||
120 | @@ -35,8 +35,9 @@ | ||
121 | s/CONFIG_/OPTION_/g; | ||
122 | print; | ||
123 | } elsif (/^\s*#\s+CONFIG_(\w+) is not set/) { | ||
124 | - # this is a comment line, change CONFIG_ to OPTION_, remove this | ||
125 | - # option from option list, and convert to explicit OPTION_FOO=n | ||
126 | + # this is a comment line for an unset boolean option, change CONFIG_ | ||
127 | + # to OPTION_, remove this option from option list, and convert to | ||
128 | + # explicit OPTION_FOO=n | ||
129 | $opt = $1; | ||
130 | yank($opt); | ||
131 | s/CONFIG_/OPTION_/g; | ||
132 | @@ -46,9 +47,12 @@ | ||
133 | } | ||
134 | } | ||
135 | |||
136 | -# any options left in @options, are options that were not mentioned in | ||
137 | +# any boolean options left in @options, are options that were not mentioned in | ||
138 | # the config file, and implicitly that means the option must be set =n, | ||
139 | # so do that here. | ||
140 | foreach $opt (@option) { | ||
141 | - print "OPTION_$opt=n\n"; | ||
142 | + if ($opt =~ /=\s*[yn]/) { | ||
143 | + $opt =~ s/=\s*[yn]/=n/; | ||
144 | + print "OPTION_$opt\n"; | ||
145 | + } | ||
146 | } | ||
147 | Index: libc/scripts/option-groups.awk | ||
148 | =================================================================== | ||
149 | --- libc.orig/scripts/option-groups.awk 2012-01-04 22:06:00.000000000 -0800 | ||
150 | +++ libc/scripts/option-groups.awk 2012-05-09 19:35:28.610682107 -0700 | ||
151 | @@ -46,9 +46,15 @@ | ||
152 | print "#define __" var " 1" | ||
153 | else if (vars[var] == "n") | ||
154 | print "/* #undef __" var " */" | ||
155 | - # Ignore variables that don't have boolean values. | ||
156 | - # Ideally, this would be driven by the types given in | ||
157 | - # option-groups.def. | ||
158 | + else if (vars[var] ~ /^[0-9]+/ || | ||
159 | + vars[var] ~ /^0x[0-9aAbBcCdDeEfF]+/ || | ||
160 | + vars[var] ~ /^\"/) | ||
161 | + print "#define __" var " " vars[var] | ||
162 | + else | ||
163 | + print "/* #undef __" var " */" | ||
164 | + # Ignore variables that don't have boolean, int, hex, or | ||
165 | + # string values. Ideally, this would be driven by the types | ||
166 | + # given in option-groups.def. | ||
167 | } | ||
168 | } | ||
169 | |||