Modificando o Linux e os Programas

1. Modificando o Linux e os Programas

Fábio Silva
maketux

(usa Slackware)

Enviado em 05/02/2013 - 01:48h

Como o Linux e os programas de Software Livre tem código-aberto, gostaria de saber, como vocês modificam seu sistema e/ou programas para rodarem de forma otimizada ou personalizada de acordo com o gosto de cada um.

Exemplo: Pegar o código do Linux, modificar ele e fazer a distro X, ser de tal modo. Ou baixar o GIMP, alterar o código e programar, adicionar funções que antes não existiam.


  


2. Re: Modificando o Linux e os Programas

Andre (pinduvoz)
pinduvoz

(usa Debian)

Enviado em 05/02/2013 - 02:32h

Funciona assim:

- o Linux e os programas do Projeto GNU, que juntos formam um SO completo cujo nome correto é GNU/Linux, são distribuídos compilados (binários) e em código-fonte (linguagem de programação);

- qualquer um (*) pode baixar o código-fonte e alterá-lo para excluir ou incluir funções, estando obrigado a redistribuir o código-fonte alterado;

- cada acréscimo no código-fonte implica, ao menos em tese, em desenvolvimento desse mesmo código-fonte, para benefício de todos que o utilizam compilado.

É um "esquema" muito interessante de desenvolver software, que pode ser totalmente ou parcialmente aberto, ou seja, nas formas descritas no livro a "A Catedral e o Bazar", de Eric Steven Raymond (ESR), autor da famosa frase:

"Havendo olhos suficientes, todos os erros são óbvios (Given enough eyeballs, all bugs are shallow)."

A frase supra viria a se transformar na "Lei de Linus", em alusão ao modo como Linus Torvalds desenvolveu o Kernel Linux.

Seu significado principal, não tão evidente na tradução, está ligado ao fato de a progressão no número de desenvolvedores, obtida pelo modelo Bazar de desenvolvimento (código-fonte disponível a todos, via internet), possibilita rapidez inigualável, já que serão muitos "olhos" sobre o código-fonte, procurando e resolvendo bugs.

No modelo Catedral, por sua vez, temos um grupo fechado de programadores comprometidos com determinado projeto, que pode ou não de código aberto ou livre, já que o software proprietário também segue esse modelo. Isso significa que o projeto de software será "visto" por um número limitado de "olhos" durante o processo de desenvolvimento, tornando-o mais lento.

---
(*) é óbvio que só poderá alterar o código-fonte quem tiver capacidade técnica para tanto, sendo a expressão "qualquer um" entendida como "qualquer pessoa capaz de".


3. Re: Modificando o Linux e os Programas

Fábio Silva
maketux

(usa Slackware)

Enviado em 05/02/2013 - 02:45h

pinduvoz

Sua resposta foi excelente e muito completa, obrigado!

Mas, o que eu queria mesmo é saber dos membros do VOL, modificações que já fizeram em programas já existentes ou nas distros que cada um usa, através de "Programação"

Sejam pequenos shells scripts, modificações de software em C/C++ ou otimização do hardware em Assembly.

Já que o Software Livre nos dá essa liberdade de modificar algo já existente ou começar algo do zero.


4. Re: Modificando o Linux e os Programas

Andre (pinduvoz)
pinduvoz

(usa Debian)

Enviado em 05/02/2013 - 03:05h

Um exemplo do que vc quer:

http://va.mu/cIMz

Na prática, pouca gente vai além disso que está link.

São muitas as opções prontas, e geralmente dá para se virar muito bem elas e, assim, evitar a necessidade de modificações.


5. Re: Modificando o Linux e os Programas

Jadson
jadsonbr

(usa Debian)

Enviado em 22/06/2017 - 09:38h

pinduvoz escreveu:

Um exemplo do que vc quer:

http://va.mu/cIMz

Na prática, pouca gente vai além disso que está link.

São muitas as opções prontas, e geralmente dá para se virar muito bem elas e, assim, evitar a necessidade de modificações.


Poderia enviar o link novamente.




6. Re: Modificando o Linux e os Programas

Perfil removido
removido

(usa Nenhuma)

Enviado em 22/06/2017 - 10:02h

90% e conserto pro Musl ou GCC7


Patches originally from Alpine linux to fix building
on musl, have been adapted to work on /etc/portage/patches

diff --git parser/missingdefs.h parser/missingdefs.h
new file mode 100644
index 0000000..8097aef
--- /dev/null
+++ parser/missingdefs.h
@@ -0,0 +1,8 @@
+#ifndef PARSER_MISSINGDEFS_H
+#define PARSER_MISSINGDEFS_H
+
+typedef int (*__compar_fn_t) (const void *, const void *);
+typedef __compar_fn_t comparison_fn_t;
+typedef void (*__free_fn_t) (void *__nodep);
+
+#endif
diff --git parser/parser_alias.c parser/parser_alias.c
index f5b6da4..d50a72b 100644
--- parser/parser_alias.c
+++ parser/parser_alias.c
@@ -24,6 +24,7 @@
#include "immunix.h"
#include "parser.h"
#include "profile.h"
+#include "missingdefs.h"

struct alias_rule {
char *from;
diff --git parser/parser_symtab.c parser/parser_symtab.c
index 3e667d8..d5a8270 100644
--- parser/parser_symtab.c
+++ parser/parser_symtab.c
@@ -24,6 +24,7 @@

#include "immunix.h"
#include "parser.h"
+#include "missingdefs.h"

enum var_type {
sd_boolean,


diff --git parser/parser_include.c parser/parser_include.c
index f4f1e23..9fc8b83 100644
--- parser/parser_include.c
+++ parser/parser_include.c
@@ -45,6 +45,7 @@
#include <unistd.h>
#include <errno.h>
#include <dirent.h>
+#include <limits.h>

#include "lib.h"
#include "parser.h"


diff --git parser/parser_misc.c parser/parser_misc.c
index f7772e6..90e8b9c 100644
--- parser/parser_misc.c
+++ parser/parser_misc.c
@@ -124,6 +124,9 @@ static struct keyword_table rlimit_table[] = {
{"core", RLIMIT_CORE},
{"rss", RLIMIT_RSS},
{"nofile", RLIMIT_NOFILE},
+#ifndef RLIMIT_OFILE
+#define RLIMIT_OFILE RLIMIT_NOFILE
+#endif
{"ofile", RLIMIT_OFILE},
{"as", RLIMIT_AS},
{"nproc", RLIMIT_NPROC},
--
2.11.2


diff --git parser/parser_yacc.y parser/parser_yacc.y
index 3e2bcd2..a6f12e5 100644
--- parser/parser_yacc.y
+++ parser/parser_yacc.y
@@ -902,6 +902,7 @@ rules: rules TOK_SET TOK_RLIMIT TOK_ID TOK_LE TOK_VALUE opt_id TOK_END_OF_RULE
pwarn(_("RLIMIT 'cpu' no units specified using default units of seconds\n"));
value = tmp;
break;
+#ifdef RLIMIT_RTTIME
case RLIMIT_RTTIME:
/* RTTIME is measured in microseconds */
if (!end || $6 == end || tmp < 0)
@@ -913,6 +914,7 @@ rules: rules TOK_SET TOK_RLIMIT TOK_ID TOK_LE TOK_VALUE opt_id TOK_END_OF_RULE
pwarn(_("RLIMIT 'rttime' no units specified using default units of microseconds\n"));
value = tmp;
break;
+#endif
case RLIMIT_NOFILE:
case RLIMIT_NPROC:
case RLIMIT_LOCKS:
--
2.11.2


diff --git a/config.h b/config.h
index 1c58d0b..0756132 100644
--- a/config.h
+++ b/config.h
@@ -13,13 +13,13 @@ static const float resize_keep_aspect_ratio= 1.03;
///---Offsets---///
/*0)offsetx 1)offsety
*2)maxwidth 3)maxheight */
-static const uint8_t offsets[] = {0,0,0,0};
+static const uint8_t offsets[] = {0,0,0,40};
///---Colors---///
/*0)focuscol 1)unfocuscol
*2)fixedcol 3)unkilcol
*4)fixedunkilcol 5)outerbordercol
*6)emptycol */
-static const char *colors[] = {"#35586c","#333333","#7a8c5c","#ff6666","#cc9933","#0d131a","#000000"};
+static const char *colors[] = {"#cef318","#333333","#7a8c5c","#ff6666","#cc9933","#0d131a","#000000"};
/* if this is set to true the inner border and outer borders colors will be swapped */
static const bool inverted_colors = true;
///---Cursor---///
@@ -39,8 +39,6 @@ static const uint8_t borders[] = {3,5,5,4};
*/
#define LOOK_INTO "WM_NAME"
static const char *ignore_names[] = {"bar", "xclock"};
-///--Menus and Programs---///
-static const char *menucmd[] = { "", NULL };
///--Custom foo---///
static void halfandcentered(const Arg *arg)
{
@@ -83,6 +81,8 @@ static key keys[] = {
// Focus to next/previous window
{ MOD , XK_Tab, focusnext, {.i=TWOBWM_FOCUS_NEXT}},
{ MOD |SHIFT, XK_Tab, focusnext, {.i=TWOBWM_FOCUS_PREVIOUS}},
+ { MOD , XK_o, focusnext, {.i=TWOBWM_FOCUS_NEXT}},
+ { MOD , XK_i, focusnext, {.i=TWOBWM_FOCUS_PREVIOUS}},
// Kill a window
{ MOD , XK_q, deletewin, {}},
// Resize a window
@@ -152,7 +152,7 @@ static key keys[] = {
{ MOD , XK_comma, changescreen, {.i=TWOBWM_NEXT_SCREEN}},
{ MOD , XK_period, changescreen, {.i=TWOBWM_PREVIOUS_SCREEN}},
// Raise or lower a window
- { MOD , XK_r, raiseorlower, {}},
+ { MOD |SHIFT , XK_r, raiseorlower, {}},
// Next/Previous workspace
{ MOD , XK_v, nextworkspace, {}},
{ MOD , XK_c, prevworkspace, {}},
@@ -177,8 +177,6 @@ static key keys[] = {
{ MOD |SHIFT, XK_Down, cursor_move, {.i=TWOBWM_CURSOR_DOWN}},
{ MOD |SHIFT, XK_Right, cursor_move, {.i=TWOBWM_CURSOR_RIGHT}},
{ MOD |SHIFT, XK_Left, cursor_move, {.i=TWOBWM_CURSOR_LEFT}},
- // Start programs
- { MOD , XK_w, start, {.com = menucmd}},
// Exit or restart 2bwm
{ MOD |CONTROL, XK_q, twobwm_exit, {.i=0}},
{ MOD |CONTROL, XK_r, twobwm_restart, {.i=0}},
@@ -190,16 +188,11 @@ static key keys[] = {
DESKTOPCHANGE( XK_4, 3)
DESKTOPCHANGE( XK_5, 4)
DESKTOPCHANGE( XK_6, 5)
- DESKTOPCHANGE( XK_7, 6)
- DESKTOPCHANGE( XK_8, 7)
- DESKTOPCHANGE( XK_9, 8)
- DESKTOPCHANGE( XK_0, 9)
};
// the last argument makes it a root window only event
static Button buttons[] = {
{ MOD ,XCB_BUTTON_INDEX_1, mousemotion, {.i=TWOBWM_MOVE}, false},
{ MOD ,XCB_BUTTON_INDEX_3, mousemotion, {.i=TWOBWM_RESIZE}, false},
- { 0 ,XCB_BUTTON_INDEX_3, start, {.com = menucmd}, true},
{ MOD|SHIFT, XCB_BUTTON_INDEX_1, changeworkspace, {.i=0}, false},
{ MOD|SHIFT, XCB_BUTTON_INDEX_3, changeworkspace, {.i=1}, false},
{ MOD|ALT, XCB_BUTTON_INDEX_1, changescreen, {.i=1}, false},


diff --git a/config.def.h b/config.def.h
index ad8283a..f782572 100644
--- a/config.def.h
+++ b/config.def.h
@@ -1,4 +1,4 @@
-static const char *font = "-*-*-medium-*-*-*-14-*-*-*-*-*-*-*";
+static const char *font = "-Misc-Fixed-Medium-R-SemiCondensed--13-120-75-75-C-60-ISO8859-1";
static const char *prompt = "exec> ";
static const char *normbgcolor = "#222222";
static const char *normfgcolor = "#cccccc";


diff --git a/src/start_kdeinit/start_kdeinit.c b/src/start_kdeinit/start_kdeinit.c
index 2765901..f6fedf6 100644
--- a/src/start_kdeinit/start_kdeinit.c
+++ b/src/start_kdeinit/start_kdeinit.c
@@ -19,6 +19,7 @@

#include <config-kdeinit.h>

+#define _POSIX_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <signal.h>


diff --git a/src/kpac/kpac_dhcp_helper.c b/src/kpac/kpac_dhcp_helper.c
index a18367b..f470785 100644
--- a/src/kpac/kpac_dhcp_helper.c
+++ b/src/kpac/kpac_dhcp_helper.c
@@ -17,6 +17,7 @@
Boston, MA 02110-1301, USA.
*/

+#define _BSD_SOURCE
#include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/types.h>


From e2520914c446d8646088bc3aa061b5723aa52036 Mon Sep 17 00:00:00 2001
From: "A. Wilcox" <[email protected]>
Date: Wed, 20 Jul 2016 21:19:14 -0500
Subject: [PATCH] Determine if _nl_msg_cat_cntr exists before use

GNU gettext does not guarantee that GNU libintl will be used. This
assumption breaks the build against the musl libc.

BUG: 365917
---
.gitignore | 1 +
CMakeLists.txt | 3 +++
cmake/FindLibIntl.cmake | 3 +++
src/config.h.in | 25 +++++++++++++++++++++++++
src/kcatalog.cpp | 5 +++--
5 files changed, 35 insertions(+), 2 deletions(-)
create mode 100644 src/config.h.in

diff --git a/.gitignore b/.gitignore
index 1a6b0c4..42a96a7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
doc-gen/
+src/config.h
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 00e4001..09dc6af 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -59,6 +59,9 @@ endif()
add_subdirectory(src)
add_subdirectory(autotests)

+configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in"
+ "${CMAKE_CURRENT_SOURCE_DIR}/src/config.h")
+
# create a Config.cmake and a ConfigVersion.cmake file and install them
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5I18n")

diff --git a/cmake/FindLibIntl.cmake b/cmake/FindLibIntl.cmake
index cde5da8..a457112 100644
--- a/cmake/FindLibIntl.cmake
+++ b/cmake/FindLibIntl.cmake
@@ -56,3 +56,6 @@ else()
message(STATUS "libintl is a separate library.")
find_package_handle_standard_args(LibIntl REQUIRED_VARS LibIntl_INCLUDE_DIRS LibIntl_LIBRARIES)
endif()
+
+set(CMAKE_REQUIRED_LIBRARIES ${LibIntl_LIBRARIES})
+check_cxx_source_compiles("extern \"C\" int _nl_msg_cat_cntr; int main(void) { ++_nl_msg_cat_cntr; return 0; }" HAVE_NL_MSG_CAT_CNTR)
diff --git a/src/config.h.in b/src/config.h.in
new file mode 100644
index 0000000..f445f88
--- /dev/null
+++ b/src/config.h.in
@@ -0,0 +1,25 @@
+/* This file is part of the KDE libraries
+ Copyright (c) 2016 A. Wilcox <[email protected]>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef CONFIG_H
+#define CONFIG_H
+
+#cmakedefine HAS_NL_MSG_CAT_CNTR
+
+#endif
diff --git a/src/kcatalog.cpp b/src/kcatalog.cpp
index 6682d62..a15e661 100644
--- a/src/kcatalog.cpp
+++ b/src/kcatalog.cpp
@@ -21,6 +21,7 @@
#include <stdlib.h>
#include <locale.h>
#include "gettext.h"
+#include "config.h"

#include <qstandardpaths.h>
#include <QByteArray>
@@ -41,7 +42,7 @@
#endif
#endif

-#if defined(__USE_GNU_GETTEXT)
+#if defined(HAS_NL_MSG_CAT_CNTR)
extern "C" int Q_DECL_IMPORT _nl_msg_cat_cntr;
#endif

@@ -171,9 +172,9 @@ void KCatalogPrivate::setupGettextEnv()
//qDebug() << "bindtextdomain" << domain << localeDir;
bindtextdomain(domain, localeDir);

+#if defined(HAS_NL_MSG_CAT_CNTR)
// Magic to make sure GNU Gettext doesn't use stale cached translation
// from previous language.
-#if defined(__USE_GNU_GETTEXT)
++_nl_msg_cat_cntr;
#endif
}
--
2.9.2


sys/types.h is required to use dev_t in POSIX environments.

--- solid-5.21.0/src/solid/devices/backends/udisks2/udisksblock.old 2016-04-03 22:08:10.000000000 +0100
+++ solid-5.21.0/src/solid/devices/backends/udisks2/udisksblock.h 2016-07-21 08:19:08.410880257 +0100
@@ -22,6 +22,7 @@
#define UDISKS2BLOCK_H

#include <solid/devices/ifaces/block.h>
+#include <sys/types.h>
#include "udisksdeviceinterface.h"

namespace Solid


From 64fdd317d4127142ad9e967197a2df6ac81ef55f Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <[email protected]>
Date: Wed, 29 Mar 2017 17:42:18 +0200
Subject: [PATCH] Fix build with GCC 7.0
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit

Fixes some ambiguities and outright wrong code GCC 7 doesn't accept but
earlier compilers did.

Task-number:QTBUG-59776
Change-Id: I012f121842ac6cde49db0d571efc62aabe2115e3
Reviewed-by: Michael Brüning <[email protected]>
---
.../mojo/public/cpp/bindings/interface_ptr_info.h | 2 +-
.../third_party/WebKit/Source/wtf/LinkedHashSet.h | 2 ++
chromium/v8/src/objects-body-descriptors.h | 2 +-
chromium/v8/src/objects-inl.h | 19 +++++++++++++++++++
chromium/v8/src/objects.h | 16 ++--------------
5 files changed, 25 insertions(+), 16 deletions(-)

diff --git a/src/3rdparty/chromium/mojo/public/cpp/bindings/interface_ptr_info.h b/src/3rdparty/chromium/mojo/public/cpp/bindings/interface_ptr_info.h
index 5bd29d5..c94a5ac 100644
--- a/src/3rdparty/chromium/mojo/public/cpp/bindings/interface_ptr_info.h
+++ b/src/3rdparty/chromium/mojo/public/cpp/bindings/interface_ptr_info.h
@@ -34,7 +34,7 @@ class InterfacePtrInfo {

InterfacePtrInfo& operator=(InterfacePtrInfo&& other) {
if (this != &other) {
- handle_ = other.handle_.Pass();
+ handle_ = std::move(other.handle_);
version_ = other.version_;
other.version_ = 0u;
}
--
2.7.4

From 493441248c82d9f39d0947e3bbf4571736e1cf85 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <[email protected]>
Date: Wed, 29 Mar 2017 15:53:00 +0200
Subject: [PATCH 1/1] Fix build with GCC 7.0
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit

Fixes a few problems with using undeclared functions and ambigious
code.

Task-number: QTBUG-59776
Change-Id: I59813919b4867d5dd3499a45baed004a1a1c1a3c
Reviewed-by: Michael Brüning <[email protected]>
---
chromium/third_party/WebKit/Source/wtf/LinkedHashSet.h | 2 ++
.../third_party/pdfium/fpdfsdk/javascript/global.cpp | 8 ++++----
chromium/v8/src/objects-body-descriptors.h | 2 +-
chromium/v8/src/objects-inl.h | 18 ++++++++++++++++++
chromium/v8/src/objects.h | 16 ++--------------
5 files changed, 27 insertions(+), 19 deletions(-)

diff --git a/src/3rdparty/chromium/third_party/WebKit/Source/wtf/LinkedHashSet.h b/src/3rdparty/chromium/third_party/WebKit/Source/wtf/LinkedHashSet.h
index e85c72f..6f94cd6 100644
--- a/src/3rdparty/chromium/third_party/WebKit/Source/wtf/LinkedHashSet.h
+++ b/src/3rdparty/chromium/third_party/WebKit/Source/wtf/LinkedHashSet.h
@@ -542,6 +542,8 @@ inline LinkedHashSet<T, U, V, W>& LinkedHashSet<T, U, V, W>::operator=(LinkedHas
return *this;
}

+inline void swapAnchor(LinkedHashSetNodeBase& a, LinkedHashSetNodeBase& b);
+
template<typename T, typename U, typename V, typename W>
inline void LinkedHashSet<T, U, V, W>::swap(LinkedHashSet& other)
{
diff --git a/src/3rdparty/chromium/v8/src/objects-body-descriptors.h b/src/3rdparty/chromium/v8/src/objects-body-descriptors.h
index 91cb888..a1c3634 100644
--- a/src/3rdparty/chromium/v8/src/objects-body-descriptors.h
+++ b/src/3rdparty/chromium/v8/src/objects-body-descriptors.h
@@ -99,7 +99,7 @@ class FixedBodyDescriptor final : public BodyDescriptorBase {

template <typename StaticVisitor>
static inline void IterateBody(HeapObject* obj, int object_size) {
- IterateBody(obj);
+ IterateBody<StaticVisitor>(obj);
}
};

diff --git a/src/3rdparty/chromium/v8/src/objects-inl.h b/src/3rdparty/chromium/v8/src/objects-inl.h
index 58441d3..4c486ea 100644
--- a/src/3rdparty/chromium/v8/src/objects-inl.h
+++ b/src/3rdparty/chromium/v8/src/objects-inl.h
@@ -7588,6 +7588,24 @@ bool GlobalDictionaryShape::IsDeleted(Dictionary* dict, int entry) {
}


+template <typename Derived, typename Shape, typename Key>
+inline uint32_t HashTable<Derived,Shape,Key>::Hash(Key key) {
+ if (Shape::UsesSeed) {
+ return Shape::SeededHash(key, GetHeap()->HashSeed());
+ } else {
+ return Shape::Hash(key);
+ }
+}
+
+template <typename Derived, typename Shape, typename Key>
+inline uint32_t HashTable<Derived,Shape,Key>::HashForObject(Key key, Object* object) {
+ if (Shape::UsesSeed) {
+ return Shape::SeededHashForObject(key, GetHeap()->HashSeed(), object);
+ } else {
+ return Shape::HashForObject(key, object);
+ }
+}
+
bool ObjectHashTableShape::IsMatch(Handle<Object> key, Object* other) {
return key->SameValue(other);
}
diff --git a/src/3rdparty/chromium/v8/src/objects.h b/src/3rdparty/chromium/v8/src/objects.h
index 7d774be..42da5fa 100644
--- a/src/3rdparty/chromium/v8/src/objects.h
+++ b/src/3rdparty/chromium/v8/src/objects.h
@@ -3194,21 +3194,9 @@ class HashTable : public HashTableBase {
typedef Shape ShapeT;

// Wrapper methods
- inline uint32_t Hash(Key key) {
- if (Shape::UsesSeed) {
- return Shape::SeededHash(key, GetHeap()->HashSeed());
- } else {
- return Shape::Hash(key);
- }
- }
+ inline uint32_t Hash(Key key);

- inline uint32_t HashForObject(Key key, Object* object) {
- if (Shape::UsesSeed) {
- return Shape::SeededHashForObject(key, GetHeap()->HashSeed(), object);
- } else {
- return Shape::HashForObject(key, object);
- }
- }
+ inline uint32_t HashForObject(Key key, Object* object);

// Returns a new HashTable object.
MUST_USE_RESULT static Handle<Derived> New(
--
2.7.4


diff --git a/libraries/libapparmor/include/sys/apparmor.h b/libraries/libapparmor/include/sys/apparmor.h
index 752a5bd..0944c4c 100644
--- a/libraries/libapparmor/include/sys/apparmor.h
+++ b/libraries/libapparmor/include/sys/apparmor.h
@@ -22,7 +22,9 @@
#include <stdint.h>
#include <sys/types.h>

-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif

/*
* Class of public mediation types in the AppArmor policy db
@@ -191,6 +193,8 @@ extern int aa_policy_cache_remove(int dirfd, const char *path);
extern int aa_policy_cache_replace_all(aa_policy_cache *policy_cache,
aa_kernel_interface *kernel_interface);

-__END_DECLS
+#ifdef __cplusplus
+}
+#endif

#endif /* sys/apparmor.h */
diff --git a/libraries/libapparmor/include/sys/apparmor_private.h b/libraries/libapparmor/include/sys/apparmor_private.h
index 6472de9..00bbee4 100644
--- a/libraries/libapparmor/include/sys/apparmor_private.h
+++ b/libraries/libapparmor/include/sys/apparmor_private.h
@@ -20,7 +20,9 @@
#include <stdio.h>
#include <sys/stat.h>

-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif

int _aa_is_blacklisted(const char *name);

@@ -33,6 +35,8 @@ int _aa_asprintf(char **strp, const char *fmt, ...);
int _aa_dirat_for_each(int dirfd, const char *name, void *data,
int (* cb)(int, const char *, struct stat *, void *));

-__END_DECLS
+#ifdef __cplusplus
+}
+#endif

#endif /* sys/apparmor_private.h */
--
2.11.2


diff --git a/libraries/libapparmor/configure.ac b/libraries/libapparmor/configure.ac
index 479ba6d..afbb8e2 100644
--- a/libraries/libapparmor/configure.ac
+++ b/libraries/libapparmor/configure.ac
@@ -81,7 +81,7 @@ AM_CONDITIONAL(HAVE_RUBY, test x$with_ruby = xyes)
AC_HEADER_STDC
AC_CHECK_HEADERS(unistd.h stdint.h syslog.h)

-AC_CHECK_FUNCS([asprintf __secure_getenv secure_getenv])
+AC_CHECK_FUNCS([asprintf __secure_getenv secure_getenv scandirat])

AM_PROG_CC_C_O
AC_C_CONST
diff --git a/libraries/libapparmor/src/Makefile.am b/libraries/libapparmor/src/Makefile.am
index dd393a9..b7452ab 100644
--- a/libraries/libapparmor/src/Makefile.am
+++ b/libraries/libapparmor/src/Makefile.am
@@ -46,9 +46,9 @@ af_protos.h: /usr/include/netinet/in.h
LC_ALL=C sed -n -e "/IPPROTO_MAX/d" -e "s/^\#define[ \\t]\\+IPPROTO_\\([A-Z0-9_]\\+\\)\\(.*\\)$$/AA_GEN_PROTO_ENT(\\UIPPROTO_\\1, \"\\L\\1\")/p" $< > [email protected]

lib_LTLIBRARIES = libapparmor.la
-noinst_HEADERS = grammar.h parser.h scanner.h af_protos.h private.h
+noinst_HEADERS = grammar.h parser.h scanner.h af_protos.h secure_getenv.h scandirat.h private.h

-libapparmor_la_SOURCES = grammar.y libaalogparse.c kernel.c scanner.c private.c features.c kernel_interface.c policy_cache.c
+libapparmor_la_SOURCES = grammar.y libaalogparse.c kernel.c scanner.c secure_getenv.c scandirat.c private.c features.c kernel_interface.c policy_cache.c
libapparmor_la_LDFLAGS = -version-info $(AA_LIB_CURRENT):$(AA_LIB_REVISION):$(AA_LIB_AGE) -XCClinker -dynamic -pthread \
-Wl,--version-script=$(top_srcdir)/src/libapparmor.map

diff --git a/libraries/libapparmor/src/private.c b/libraries/libapparmor/src/private.c
index 9378e22..b1c4805 100644
--- a/libraries/libapparmor/src/private.c
+++ b/libraries/libapparmor/src/private.c
@@ -39,10 +39,14 @@
#ifdef HAVE___SECURE_GETENV
#define secure_getenv __secure_getenv
#else
- #error neither secure_getenv nor __secure_getenv is available
+ #include "secure_getenv.h"
#endif
#endif

+#ifndef HAVE_SCANDIRAT
+#include "scandirat.h"
+#endif
+
struct ignored_suffix_t {
const char * text;
int len;
diff --git a/libraries/libapparmor/src/scandirat.c b/libraries/libapparmor/src/scandirat.c
new file mode 100644
index 0000000..1576a35
--- /dev/null
+++ b/libraries/libapparmor/src/scandirat.c
@@ -0,0 +1,63 @@
+#include <dirent.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <inttypes.h>
+#include <errno.h>
+
+#include "scandirat.h"
+
+#ifndef HAVE_SCANDIRAT
+
+int scandirat(int dir_fd, const char *dirp, struct dirent ***namelist,
+ int (*filter)(const struct dirent *),
+ int (*compar)(const struct dirent **, const struct dirent **))
+{
+ int fd;
+ DIR *d;
+ struct dirent *de, **names=0, **tmp;
+ size_t cnt=0, len=0;
+ int old_errno = errno;
+
+
+ fd = openat(dir_fd, dirp, O_RDONLY|O_CLOEXEC);
+ if (fd == -1) return -1;
+
+ d = fdopendir(fd);
+
+ if (!d) {
+ close(fd);
+ return -1;
+ }
+
+ while ((errno=0), (de = readdir(d))) {
+ if (filter && !filter(de)) continue;
+ if (cnt >= len) {
+ len = 2*len+1;
+ if (len > SIZE_MAX/sizeof *names) break;
+ tmp = realloc(names, len * sizeof *names);
+ if (!tmp) break;
+ names = tmp;
+ }
+ names[cnt] = malloc(de->d_reclen);
+ if (!names[cnt]) break;
+ memcpy(names[cnt++], de, de->d_reclen);
+ }
+
+ closedir(d);
+
+ if (errno) {
+ if (names) while (cnt-->0) free(names[cnt]);
+ free(names);
+ return -1;
+ }
+ errno = old_errno;
+
+ if (compar) qsort(names, cnt, sizeof *names, (int (*)(const void *, const void *))compar);
+ *namelist = names;
+ return cnt;
+}
+
+#endif
+
diff --git a/libraries/libapparmor/src/scandirat.h b/libraries/libapparmor/src/scandirat.h
new file mode 100644
index 0000000..6f4bf03
--- /dev/null
+++ b/libraries/libapparmor/src/scandirat.h
@@ -0,0 +1,13 @@
+#ifndef LIBAPPARMOR_SCANDIRAT_H
+#define LIBAPPARMOR_SCANDIRAT_H
+
+#include <dirent.h>
+
+#ifndef HAVE_SCANDIRAT
+int scandirat(int dir_fd, const char *dirp, struct dirent ***namelist,
+ int (*filter)(const struct dirent *),
+ int (*compar)(const struct dirent **, const struct dirent **));
+#endif
+
+#endif
+
diff --git a/libraries/libapparmor/src/secure_getenv.c b/libraries/libapparmor/src/secure_getenv.c
new file mode 100644
index 0000000..b5eb46e
--- /dev/null
+++ b/libraries/libapparmor/src/secure_getenv.c
@@ -0,0 +1,15 @@
+#include <stdlib.h>
+#include <sys/auxv.h>
+
+#include "secure_getenv.h"
+
+#ifndef HAVE_SECURE_GETENV
+char *secure_getenv(const char *name)
+{
+ if (!getauxval(AT_SECURE)) {
+ return getenv(name);
+ }
+ return NULL;
+}
+#endif
+
diff --git a/libraries/libapparmor/src/secure_getenv.h b/libraries/libapparmor/src/secure_getenv.h
new file mode 100644
index 0000000..b6269a8
--- /dev/null
+++ b/libraries/libapparmor/src/secure_getenv.h
@@ -0,0 +1,8 @@
+#ifndef LIBAPPARMOR_SECURE_GETENV_H
+#define LIBAPPARMOR_SECURE_GETENV_H
+
+#ifndef HAVE_SECURE_GETENV
+char *secure_getenv(const char *name);
+#endif
+
+#endif
--
2.11.2


diff --git a/admin/runit-2.1.2/src/runsv.c b/admin/runit-2.1.2/src/runsv.c
index 0de2803..51b62bf 100644
--- a/admin/runit-2.1.2/src/runsv.c
+++ b/admin/runit-2.1.2/src/runsv.c
@@ -20,6 +20,10 @@
#include "fmt.h"
#include "byte.h"

+#if defined(__linux__)
+#include <sys/prctl.h>
+#endif
+
#define USAGE " dir"

#define VERSION "$Id: ecf467746d7b97ff0fddb88b9d44cca201c74160 $"
@@ -402,6 +406,10 @@ int main(int argc, char **argv) {
sig_block(sig_term);
sig_catch(sig_term, s_term);

+ #ifdef PR_SET_CHILD_SUBREAPER
+ if(prctl(PR_SET_CHILD_SUBREAPER) == -1) fatal("Failed to register as child subreaper");
+ #endif
+
if (chdir(dir) == -1) fatal("unable to change to directory");
svd[0].pid =0;
svd[0].state =S_DOWN;


diff --git a/compat.h b/compat.h
index 85befd3..7cadae9 100644
--- a/compat.h
+++ b/compat.h
@@ -666,6 +666,10 @@ typedef int sig_atomic_t;
# define NETDB_INTERNAL h_NETDB_INTERNAL
#endif

+#if !defined(NETDB_INTERNAL)
+# define NETDB_INTERNAL (-1)
+#endif
+
#ifndef INET_ADDRSTRLEN
# define INET_ADDRSTRLEN sizeof(struct sockaddr_in)
#endif


diff --git a/configure.ac b/configure.ac
index 6f9553b..32bc98a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -30,6 +30,8 @@ AM_CONDITIONAL(NS_FIXED, [test "x${NS_FIXED}" = "x1"])
# Borrowed from gst-plugins-bad
AC_CHECK_HEADER(MobileCoreServices/MobileCoreServices.h, HAVE_IOS="yes", HAVE_IOS="no", [-])

+AC_CHECK_HEADERS([cxxabi.h execinfo.h])
+
# Based on gst-plugins-bad configure.ac and defines in
# <chromium source>/build/config/BUILDCONFIG.gn and
# webrtc/BUILD.gn
diff --git a/webrtc/base/checks.cc b/webrtc/base/checks.cc
index 49a31f2..05d23a6 100644
--- a/webrtc/base/checks.cc
+++ b/webrtc/base/checks.cc
@@ -16,7 +16,7 @@
#include <cstdio>
#include <cstdlib>

-#if defined(__GLIBCXX__) && !defined(__UCLIBC__)
+#if defined(HAVE_CXX_ABI_H) && defined(HAVE_EXECINFO_H)
#include <cxxabi.h>
#include <execinfo.h>
#endif
@@ -55,7 +55,7 @@ void PrintError(const char* format, ...) {
// to get usable symbols on Linux. This is copied from V8. Chromium has a more
// advanced stace trace system; also more difficult to copy.
void DumpBacktrace() {
-#if defined(__GLIBCXX__) && !defined(__UCLIBC__)
+#if defined(HAVE_CXX_ABI_H) && defined(HAVE_EXECINFO_H)
void* trace[100];
int size = backtrace(trace, sizeof(trace) / sizeof(*trace));
char** symbols = backtrace_symbols(trace, size);


diff --git a/trashcli/list_mount_points.py b/trashcli/list_mount_points.py
index 75607da..4d6041b 100644
--- a/trashcli/list_mount_points.py
+++ b/trashcli/list_mount_points.py
@@ -52,7 +52,7 @@ def _mounted_filesystems_from_getmnt() :
libc_name = find_library("c")

if libc_name == None :
- libc_name="/lib/libc.so.6" # fix for my Gentoo 4.0
+ libc_name="/usr/lib/libc.so" # fix for my Gentoo Musl libc

libc = cdll.LoadLibrary(libc_name)
libc.getmntent.restype = POINTER(mntent_struct)


From a1b93c25311834f2f411e9bfe2e616899ba2122d Mon Sep 17 00:00:00 2001
From: Khem Raj <[email protected]>
Date: Sun, 6 Nov 2016 10:23:55 -0800
Subject: [PATCH 3/3] Fix build breaks due to missing a.out.h

Signed-off-by: Khem Raj <[email protected]>
---
Upstream-Status: Pending

include/bsd/nlist.h | 1 -
include/bsd/nlist.h => src/local-aout.h | 47 ++++++++++++++++++++++-----------
src/nlist.c | 9 +++++++
3 files changed, 41 insertions(+), 16 deletions(-)
copy include/bsd/nlist.h => src/local-aout.h (63%)

diff --git a/include/bsd/nlist.h b/include/bsd/nlist.h
index 0389ab7..9c7e3d8 100644
--- a/include/bsd/nlist.h
+++ b/include/bsd/nlist.h
@@ -28,7 +28,6 @@
#define LIBBSD_NLIST_H

#include <sys/cdefs.h>
-#include <a.out.h>

/* __BEGIN_DECLS */
#ifdef __cplusplus
diff --git a/include/bsd/nlist.h b/src/local-aout.h
similarity index 63%
copy from include/bsd/nlist.h
copy to src/local-aout.h
index 0389ab7..2adb93e 100644
--- a/include/bsd/nlist.h
+++ b/src/local-aout.h
@@ -1,5 +1,5 @@
/*
- * Copyright © 2009 Guillem Jover <[email protected]>
+ * Copyright © 2016 Khem Raj <[email protected]>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -24,20 +24,37 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

-#ifndef LIBBSD_NLIST_H
-#define LIBBSD_NLIST_H
+#ifndef LIBBSD_LOCAL_AOUT_H
+#define LIBBSD_LOCAL_AOUT_H

-#include <sys/cdefs.h>
-#include <a.out.h>
+#define N_UNDF 0
+#define N_ABS 2
+#define N_TEXT 4
+#define N_DATA 6
+#define N_BSS 8
+#define N_FN 15
+#define N_EXT 1
+#define N_TYPE 036
+#define N_STAB 0340
+#define N_INDR 0xa
+#define N_SETA 0x14 /* Absolute set element symbol. */
+#define N_SETT 0x16 /* Text set element symbol. */
+#define N_SETD 0x18 /* Data set element symbol. */
+#define N_SETB 0x1A /* Bss set element symbol. */
+#define N_SETV 0x1C /* Pointer to set vector in data area. */

-/* __BEGIN_DECLS */
-#ifdef __cplusplus
-extern "C" {
-#endif
-extern int nlist(const char *filename, struct nlist *list);
-#ifdef __cplusplus
-}
-#endif
-/* __END_DECLS */
+struct nlist
+{
+ union
+ {
+ char *n_name;
+ struct nlist *n_next;
+ long n_strx;
+ } n_un;
+ unsigned char n_type;
+ char n_other;
+ short n_desc;
+ unsigned long n_value;
+};

-#endif
+#endif /* LIBBSD_LOCAL_AOUT_H */
diff --git a/src/nlist.c b/src/nlist.c
index 0cffe55..625d310 100644
--- a/src/nlist.c
+++ b/src/nlist.c
@@ -40,7 +40,11 @@ static char sccsid[] = "@(#)nlist.c 8.1 (Berkeley) 6/4/93";

#include <errno.h>
#include <fcntl.h>
+#ifdef __GLIBC__
#include <a.out.h>
+#else
+#define __NO_A_OUT_SUPPORT
+#endif
#include <stdio.h>
#include <string.h>
#include <unistd.h>
@@ -48,12 +52,17 @@ static char sccsid[] = "@(#)nlist.c 8.1 (Berkeley) 6/4/93";
#if !defined(__NO_A_OUT_SUPPORT)
#define _NLIST_DO_AOUT
#endif
+
#define _NLIST_DO_ELF

#ifdef _NLIST_DO_ELF
#include "local-elf.h"
#endif

+#ifdef _NLIST_DO_ELF
+#include "local-aout.h"
+#endif
+
#define SIZE_T_MAX 0xffffffffU

#ifdef _NLIST_DO_AOUT
--
2.10.2


From 88adbe1a855b7aa95bd925c80ed83c86f3fc42e3 Mon Sep 17 00:00:00 2001
From: Khem Raj <[email protected]>
Date: Sun, 6 Nov 2016 09:39:31 -0800
Subject: [PATCH 1/3] Replace __BEGIN_DECLS and __END_DECLS

Signed-off-by: Khem Raj <[email protected]>
---
Upstream-Status: Pending

include/bsd/err.h | 10 ++++++++--
include/bsd/libutil.h | 10 ++++++++--
include/bsd/md5.h | 10 ++++++++--
include/bsd/nlist.h | 10 ++++++++--
include/bsd/readpassphrase.h | 10 ++++++++--
include/bsd/stdio.h | 10 ++++++++--
include/bsd/stdlib.h | 10 ++++++++--
include/bsd/string.h | 10 ++++++++--
include/bsd/stringlist.h | 10 ++++++++--
include/bsd/unistd.h | 10 ++++++++--
include/bsd/vis.h | 10 ++++++++--
include/bsd/wchar.h | 10 ++++++++--
src/hash/sha512.h | 10 ++++++++--
13 files changed, 104 insertions(+), 26 deletions(-)

diff --git a/include/bsd/err.h b/include/bsd/err.h
index 12fd051..43dfc32 100644
--- a/include/bsd/err.h
+++ b/include/bsd/err.h
@@ -42,7 +42,10 @@

#include <stdarg.h>

-__BEGIN_DECLS
+/* __BEGIN_DECLS */
+#ifdef __cplusplus
+extern "C" {
+#endif
void warnc(int code, const char *format, ...)
__printflike(2, 3);
void vwarnc(int code, const char *format, va_list ap)
@@ -51,6 +54,9 @@ void errc(int status, int code, const char *format, ...)
__printflike(3, 4);
void verrc(int status, int code, const char *format, va_list ap)
__printflike(3, 0);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
+/* __END_DECLS */

#endif
diff --git a/include/bsd/libutil.h b/include/bsd/libutil.h
index ebb6160..28b919d 100644
--- a/include/bsd/libutil.h
+++ b/include/bsd/libutil.h
@@ -53,7 +53,10 @@ struct pidfh {
ino_t pf_ino;
};

-__BEGIN_DECLS
+/* __BEGIN_DECLS */
+#ifdef __cplusplus
+extern "C" {
+#endif
int humanize_number(char *buf, size_t len, int64_t bytes,
const char *suffix, int scale, int flags);
int expand_number(const char *_buf, uint64_t *_num);
@@ -66,7 +69,10 @@ int pidfile_close(struct pidfh *pfh);
int pidfile_remove(struct pidfh *pfh);

char *fparseln(FILE *, size_t *, size_t *, const char[3], int);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
+/* __END_DECLS */

/* humanize_number(3) */
#define HN_DECIMAL 0x01
diff --git a/include/bsd/md5.h b/include/bsd/md5.h
index 9a75fad..3531fd6 100644
--- a/include/bsd/md5.h
+++ b/include/bsd/md5.h
@@ -30,7 +30,10 @@ typedef struct MD5Context {
#include <sys/cdefs.h>
#include <sys/types.h>

-__BEGIN_DECLS
+/* __BEGIN_DECLS */
+#ifdef __cplusplus
+extern "C" {
+#endif
void MD5Init(MD5_CTX *);
void MD5Update(MD5_CTX *, const uint8_t *, size_t)
__attribute__((__bounded__(__string__,2,3)));
@@ -49,6 +52,9 @@ char *MD5FileChunk(const char *, char *, off_t, off_t)
char *MD5Data(const uint8_t *, size_t, char *)
__attribute__((__bounded__(__string__,1,2)))
__attribute__((__bounded__(__minbytes__,3,MD5_DIGEST_STRING_LENGTH)));
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
+/* __END_DECLS */

#endif /* _MD5_H_ */
diff --git a/include/bsd/nlist.h b/include/bsd/nlist.h
index 2730237..0389ab7 100644
--- a/include/bsd/nlist.h
+++ b/include/bsd/nlist.h
@@ -30,8 +30,14 @@
#include <sys/cdefs.h>
#include <a.out.h>

-__BEGIN_DECLS
+/* __BEGIN_DECLS */
+#ifdef __cplusplus
+extern "C" {
+#endif
extern int nlist(const char *filename, struct nlist *list);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
+/* __END_DECLS */

#endif
diff --git a/include/bsd/readpassphrase.h b/include/bsd/readpassphrase.h
index e1dacc3..76e0d33 100644
--- a/include/bsd/readpassphrase.h
+++ b/include/bsd/readpassphrase.h
@@ -34,8 +34,14 @@
#include <sys/cdefs.h>
#include <sys/types.h>

-__BEGIN_DECLS
+/* __BEGIN_DECLS */
+#ifdef __cplusplus
+extern "C" {
+#endif
char * readpassphrase(const char *, char *, size_t, int);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
+/* __END_DECLS */

#endif /* !_READPASSPHRASE_H_ */
diff --git a/include/bsd/stdio.h b/include/bsd/stdio.h
index 7697425..b5b3efd 100644
--- a/include/bsd/stdio.h
+++ b/include/bsd/stdio.h
@@ -41,7 +41,10 @@
#include <sys/cdefs.h>
#include <sys/types.h>

-__BEGIN_DECLS
+/* __BEGIN_DECLS */
+#ifdef __cplusplus
+extern "C" {
+#endif
const char *fmtcheck(const char *, const char *);

/* XXX: The function requires cooperation from the system libc to store the
@@ -69,7 +72,10 @@ FILE *funopen(const void *cookie,
#define fwopen(cookie, fn) funopen(cookie, NULL, fn, NULL, NULL)

int fpurge(FILE *fp);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
+/* __END_DECLS */

#endif
#endif
diff --git a/include/bsd/stdlib.h b/include/bsd/stdlib.h
index 0604cad..b9f0515 100644
--- a/include/bsd/stdlib.h
+++ b/include/bsd/stdlib.h
@@ -46,7 +46,10 @@
#include <sys/stat.h>
#include <stdint.h>

-__BEGIN_DECLS
+/* __BEGIN_DECLS */
+#ifdef __cplusplus
+extern "C" {
+#endif
uint32_t arc4random(void);
void arc4random_stir(void);
void arc4random_addrandom(u_char *dat, int datlen);
@@ -73,6 +76,9 @@ long long strtonum(const char *nptr, long long minval, long long maxval,
const char **errstr);

char *getbsize(int *headerlenp, long *blocksizep);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
+/* __END_DECLS */

#endif
diff --git a/include/bsd/string.h b/include/bsd/string.h
index ee2f953..fbf8c54 100644
--- a/include/bsd/string.h
+++ b/include/bsd/string.h
@@ -36,13 +36,19 @@
#include <sys/cdefs.h>
#include <sys/types.h>

-__BEGIN_DECLS
+/* __BEGIN_DECLS */
+#ifdef __cplusplus
+extern "C" {
+#endif
size_t strlcpy(char *dst, const char *src, size_t siz);
size_t strlcat(char *dst, const char *src, size_t siz);
char *strnstr(const char *str, const char *find, size_t str_len);
void strmode(mode_t mode, char *str);

void explicit_bzero(void *buf, size_t len);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
+/* __END_DECLS */

#endif
diff --git a/include/bsd/stringlist.h b/include/bsd/stringlist.h
index e3c42e9..40d0a52 100644
--- a/include/bsd/stringlist.h
+++ b/include/bsd/stringlist.h
@@ -43,12 +43,18 @@ typedef struct _stringlist {
size_t sl_cur;
} StringList;

-__BEGIN_DECLS
+/* __BEGIN_DECLS */
+#ifdef __cplusplus
+extern "C" {
+#endif
StringList *sl_init(void);
int sl_add(StringList *, char *);
void sl_free(StringList *, int);
char *sl_find(StringList *, const char *);
int sl_delete(StringList *, const char *, int);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
+/* __END_DECLS */

#endif /* _STRINGLIST_H */
diff --git a/include/bsd/unistd.h b/include/bsd/unistd.h
index 1f9c5f8..5b2f4c7 100644
--- a/include/bsd/unistd.h
+++ b/include/bsd/unistd.h
@@ -45,7 +45,10 @@
#define S_ISTXT S_ISVTX
#endif

-__BEGIN_DECLS
+/* __BEGIN_DECLS */
+#ifdef __cplusplus
+extern "C" {
+#endif
extern int optreset;

#ifdef LIBBSD_OVERLAY
@@ -68,6 +71,9 @@ void setproctitle(const char *fmt, ...)
__printflike(1, 2);

int getpeereid(int s, uid_t *euid, gid_t *egid);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
+/* __END_DECLS */

#endif
diff --git a/include/bsd/vis.h b/include/bsd/vis.h
index 835d2d6..63c951e 100644
--- a/include/bsd/vis.h
+++ b/include/bsd/vis.h
@@ -74,7 +74,10 @@

#include <sys/cdefs.h>

-__BEGIN_DECLS
+/* __BEGIN_DECLS */
+#ifdef __cplusplus
+extern "C" {
+#endif
char *vis(char *, int, int, int);
int strvis(char *, const char *, int);
int strvisx(char *, const char *, size_t, int);
@@ -83,6 +86,9 @@ int strunvis(char *, const char *);
int strunvisx(char *, const char *, int);
ssize_t strnunvis(char *, const char *, size_t);
int unvis(char *, int, int *, int);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
+/* __END_DECLS */

#endif /* !_VIS_H_ */
diff --git a/include/bsd/wchar.h b/include/bsd/wchar.h
index 33a500e..aa70742 100644
--- a/include/bsd/wchar.h
+++ b/include/bsd/wchar.h
@@ -43,12 +43,18 @@
#include <sys/cdefs.h>
#include <sys/types.h>

-__BEGIN_DECLS
+/* __BEGIN_DECLS */
+#ifdef __cplusplus
+extern "C" {
+#endif
wchar_t *fgetwln(FILE *stream, size_t *len);

size_t wcslcat(wchar_t *dst, const wchar_t *src, size_t size);
size_t wcslcpy(wchar_t *dst, const wchar_t *src, size_t size);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
+/* __END_DECLS */

#endif
#endif
diff --git a/src/hash/sha512.h b/src/hash/sha512.h
index 4f368a1..27ddc24 100644
--- a/src/hash/sha512.h
+++ b/src/hash/sha512.h
@@ -39,7 +39,10 @@ typedef struct SHA512Context {
unsigned char buf[128];
} SHA512_CTX;

-__BEGIN_DECLS
+/* __BEGIN_DECLS */
+#ifdef __cplusplus
+extern "C" {
+#endif

void SHA512_Init(SHA512_CTX *);
void SHA512_Update(SHA512_CTX *, const void *, size_t);
@@ -48,6 +51,9 @@ char *SHA512_End(SHA512_CTX *, char *);
char *SHA512_File(const char *, char *);
char *SHA512_FileChunk(const char *, char *, off_t, off_t);
char *SHA512_Data(const void *, unsigned int, char *);
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
+/* __END_DECLS */

#endif /* !_SHA512_H_ */
--
2.10.2


From 28fc66e8b848709a2e69dba7f07694248e0154e8 Mon Sep 17 00:00:00 2001
From: Khem Raj <[email protected]>
Date: Sun, 6 Nov 2016 09:40:43 -0800
Subject: [PATCH 2/3] Remove funopen()

Musl doesnt have prerequisites for it.

Signed-off-by: Khem Raj <[email protected]>
---
Upstream-Status: Inappropriate [musl specific]

man/Makefile.am | 1 -
src/Makefile.am | 1 -
test/Makefile.am | 1 -
3 files changed, 3 deletions(-)

diff --git a/man/Makefile.am b/man/Makefile.am
index e4d6e4a..c701d94 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -29,7 +29,6 @@ dist_man_MANS = \
flopen.3 \
fmtcheck.3 \
fparseln.3 \
- funopen.3bsd \
getbsize.3 \
getmode.3 \
getpeereid.3 \
diff --git a/src/Makefile.am b/src/Makefile.am
index ad83dbf..13225a3 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -76,7 +76,6 @@ libbsd_la_SOURCES = \
fmtcheck.c \
fparseln.c \
fpurge.c \
- funopen.c \
getbsize.c \
getpeereid.c \
hash/md5.c \
diff --git a/test/Makefile.am b/test/Makefile.am
index a75c8ff..e3a1d41 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -36,7 +36,6 @@ check_PROGRAMS = \
endian \
humanize \
fgetln \
- funopen \
fparseln \
fpurge \
md5 \
--
2.10.2



7. Re: Modificando o Linux e os Programas

Perfil removido
removido

(usa Nenhuma)

Enviado em 22/06/2017 - 10:20h

Esses sao patches de pacotes que eu mantenho no meu repositorio publico de ebuilds, denovo, grande maioria nao e minha e grande maioria conserta erros no progrma



diff --git a/src/meh.h b/src/meh.h
index afb9450..1e7a400 100644
--- a/src/meh.h
+++ b/src/meh.h
@@ -2,6 +2,7 @@
#define MEH_H MEH_H

#include <stdio.h>
+#include <sys/select.h>

struct image;


Avoid "make: `install' is up to date." on case insensitive filesystems

--- a/Makefile.in
+++ b/Makefile.in
@@ -86,3 +86,5 @@
dist: tar.bz2

# ------------------------------------------------------------------------
+
+.PHONY: install
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -136,7 +136,7 @@
$(PERL) -MExtUtils::Embed -e xsinit -- -std urxvt

rxvtperl.C: rxvtperl.xs iom_perl.h iom_perl.xs typemap typemap.iom
- PERL="$(PERL)" $(PERL) @[email protected]/ExtUtils/xsubpp -C++ -typemap @[email protected]/ExtUtils/typemap -typemap 'typemap.iom' -typemap 'typemap' -prototypes $(srcdir)/rxvtperl.xs >[email protected]
+ PERL="$(PERL)" $(PERL) /usr/bin/xsubpp -C++ -typemap @[email protected]/ExtUtils/typemap -typemap 'typemap.iom' -typemap 'typemap' -prototypes $(srcdir)/rxvtperl.xs >[email protected]

rxvtperl.o: rxvtperl.C perlxsi.c
$(COMPILE) $(PERLFLAGS) -DLIBDIR="\"$(libdir)/urxvt\"" -c $<


diff --git a/Source/JavaScriptCore/heap/MachineStackMarker.cpp b/Source/JavaScriptCore/heap/MachineStackMarker.cpp
index 883914f..df3f7aa 100644
--- a/Source/JavaScriptCore/heap/MachineStackMarker.cpp
+++ b/Source/JavaScriptCore/heap/MachineStackMarker.cpp
@@ -665,7 +665,7 @@ void* MachineThreads::Thread::Registers::framePointer() const
#error Unknown Architecture
#endif

-#elif defined(__GLIBC__)
+#elif OS(LINUX)

// The following sequence depends on glibc's sys/ucontext.h.
#if CPU(X86)
@@ -747,7 +747,7 @@ void* MachineThreads::Thread::Registers::instructionPointer() const
#error Unknown Architecture
#endif

-#elif defined(__GLIBC__)
+#elif OS(LINUX)

// The following sequence depends on glibc's sys/ucontext.h.
#if CPU(X86)
@@ -838,7 +838,7 @@ void* MachineThreads::Thread::Registers::llintPC() const
#error Unknown Architecture
#endif

-#elif defined(__GLIBC__)
+#elif OS(LINUX)

// The following sequence depends on glibc's sys/ucontext.h.
#if CPU(X86)
diff --git a/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp b/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp
index fd7f869..31fc11a 100644
--- a/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp
+++ b/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp
@@ -49,7 +49,7 @@
#include <wtf/Stopwatch.h>

#include <cxxabi.h>
-#if OS(DARWIN) || (OS(LINUX) && !PLATFORM(GTK))
+#if OS(DARWIN) || (OS(LINUX) && !PLATFORM(GTK) && defined(__GLIBC__) && !defined(__UCLIBC__))
#include <dlfcn.h>
#include <execinfo.h>
#endif
@@ -187,7 +187,7 @@ void JSGlobalObjectInspectorController::pause()

void JSGlobalObjectInspectorController::appendAPIBacktrace(ScriptCallStack* callStack)
{
-#if OS(DARWIN) || (OS(LINUX) && !PLATFORM(GTK))
+#if OS(DARWIN) || (OS(LINUX) && !PLATFORM(GTK) && defined(__GLIBC__) && !defined(__UCLIBC__))
static const int framesToShow = 31;
static const int framesToSkip = 3; // WTFGetBacktrace, appendAPIBacktrace, reportAPIException.


 
Taken from the patch at https://bugs.webkit.org/show_bug.cgi?id=167642
Adpated for qtwebkit-ng
diff --git a/Source/JavaScriptCore/runtime/JSArrayBufferView.h b/Source/JavaScriptCore/runtime/JSArrayBufferView.h
index 769150b..a5afdb9 100644
--- a/Source/JavaScriptCore/runtime/JSArrayBufferView.h
+++ b/Source/JavaScriptCore/runtime/JSArrayBufferView.h
@@ -162,7 +162,7 @@ public:
bool isNeutered() { return hasArrayBuffer() && !vector(); }
void neuter();

- void* vector()
+ void* vector() const
{
return m_vector.getPredicated(
this,


diff --git a/Source/WebKit/PlatformQt.cmake b/Source/WebKit/PlatformQt.cmake
index 30b1a37..01c2c94 100644
--- a/Source/WebKit/PlatformQt.cmake
+++ b/Source/WebKit/PlatformQt.cmake
@@ -678,6 +678,7 @@ set(WebKitWidgets_PRIVATE_HEADERS_LOCATION Headers/${PROJECT_VERSION}/QtWebKitWi
WEBKIT_FRAMEWORK(WebKitWidgets)
add_dependencies(WebKitWidgets WebKit)
set_target_properties(WebKitWidgets PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR})
+set_target_properties(WebKitWidgets PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR} LINK_FLAGS -Wl,--version-script,../../../Source/QtWebKitWidgets.version)
install(TARGETS WebKitWidgets EXPORT Qt5WebKitWidgetsTargets
DESTINATION "${LIB_INSTALL_DIR}"
INCLUDES DESTINATION "${KDE_INSTALL_INCLUDEDIR}/QtWebKitWidgets"


taken from https://github.com/qutebrowser/qutebrowser/issues/1571
diff --git a/Source/WebKit/qt/Api/qwebelement.cpp b/Source/WebKit/qt/Api/qwebelement.cpp
index 1902900..bbd70df 100644
--- a/Source/WebKit/qt/Api/qwebelement.cpp
+++ b/Source/WebKit/qt/Api/qwebelement.cpp
@@ -543,7 +543,7 @@ void QWebElement::setFocus()
*/
QRect QWebElement::geometry() const
{
- if (!m_element)
+ if (!m_element || !m_element->renderer())
return QRect();
return m_element->renderer()->absoluteBoundingBoxRect();


This is a patch that adds #include <functional> to places where std::function
is used but it's taken implicitly from other stuff.

See: http://gcc.gnu.org/gcc-7/porting_to.html
diff --git a/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.h b/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.h
index 5db264c..a20c11b 100644
--- a/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.h
+++ b/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.h
@@ -32,6 +32,7 @@
#include <wtf/Optional.h>
#include <wtf/RefCounted.h>
#include <wtf/text/WTFString.h>
+#include <functional> /* For GCC7 */

namespace Inspector {

diff --git a/Source/WebCore/css/CSSValue.h b/Source/WebCore/css/CSSValue.h
index 59dc617..f4062a9 100644
--- a/Source/WebCore/css/CSSValue.h
+++ b/Source/WebCore/css/CSSValue.h
@@ -27,6 +27,7 @@
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
#include <wtf/TypeCasts.h>
+#include <functional> /* For GCC7 */

namespace WebCore {

diff --git a/Source/WebCore/css/StyleSheetContents.h b/Source/WebCore/css/StyleSheetContents.h
index f256621..19c6b5d 100644
--- a/Source/WebCore/css/StyleSheetContents.h
+++ b/Source/WebCore/css/StyleSheetContents.h
@@ -30,6 +30,7 @@
#include <wtf/Vector.h>
#include <wtf/text/AtomicStringHash.h>
#include <wtf/text/TextPosition.h>
+#include <functional> /* For GCC7 */

namespace WebCore {

diff --git a/Source/WebCore/loader/NetscapePlugInStreamLoader.h b/Source/WebCore/loader/NetscapePlugInStreamLoader.h
index 9926c33..0abadac 100644
--- a/Source/WebCore/loader/NetscapePlugInStreamLoader.h
+++ b/Source/WebCore/loader/NetscapePlugInStreamLoader.h
@@ -31,6 +31,7 @@

#include "ResourceLoader.h"
#include <wtf/Forward.h>
+#include <functional> /* For GCC7 */

namespace WebCore {

diff --git a/Source/WebCore/loader/ResourceLoader.h b/Source/WebCore/loader/ResourceLoader.h
index 189b3bc..649ddbc 100644
--- a/Source/WebCore/loader/ResourceLoader.h
+++ b/Source/WebCore/loader/ResourceLoader.h
@@ -35,6 +35,7 @@
#include "ResourceRequest.h"
#include "ResourceResponse.h"
#include <wtf/Forward.h>
+#include <functional> /* For GCC7 */

namespace WTF {
class SchedulePair;


Taken from https://patchwork.openembedded.org/patch/139352 this silences all
GCC7 expansion to defined annoyance and allows easier tracking of the build
process
diff --git a/Source/cmake/OptionsCommon.cmake b/Source/cmake/OptionsCommon.cmake
index ddaa233..3d3cc08 100644
--- a/Source/cmake/OptionsCommon.cmake
+++ b/Source/cmake/OptionsCommon.cmake
@@ -32,6 +32,8 @@ if (COMPILER_IS_GCC_OR_CLANG)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fno-exceptions -fno-strict-aliasing")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-exceptions -fno-strict-aliasing -fno-rtti")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-expansion-to-defined")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-expansion-to-defined")
endif ()

if (COMPILER_IS_CLANG AND CMAKE_GENERATOR STREQUAL "Ninja")


diff --git a/wifish b/wifish
index d741180..9282bbd 100755
--- a/wifish
+++ b/wifish
@@ -68,7 +68,7 @@ scan_results() { # {{{ # Scans for APs or shows scanned results. Writes to $stem

echo " * Scanning For APs ..." >&2
# Get the data
- stemp=$(mktemp /tmp/$$.XXXX.menu)
+ stemp=$(mktemp /tmp/$$.menu.XXXXXX)
trap 'rm -f $stemp' INT TERM EXIT
if [ -n "$_IN_TEST" ];then # {{{ # Test/Mock mode
cat data/wscan.txt > $stemp # }}}



8. Re: Modificando o Linux e os Programas

Alberto Federman Neto.
albfneto

(usa Sabayon)

Enviado em 22/06/2017 - 18:44h

shell scripts, já fiz alguns sim, com ajuda, por não ser programador.
traduções? fiz várias.
agora otimizar pacotes pro meu micro sim, pq eu uso distros de compilação.
sabayon e gentoo. Com elas se pode otimizar o pacote pro seu micro, pq um instalador de pacotes, chamado portage,
parte de programas fonte, compila e faz o pacote no micro.
¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨
Albfneto,
Ribeirão Preto, S.P., Brasil.
Usuário Linux, Linux Counter: #479903.
Distros Favoritas: Sabayon, Gentoo, openSUSE, Mageia e OpenMandriva.


9. Re: Modificando o Linux e os Programas

Perfil removido
removido

(usa Nenhuma)

Enviado em 22/06/2017 - 19:06h

Eu já mexi sutilmente em alguma coisa do kernel e num certo driver de winmodem.
Faz tanto tempo que nem sei o que fiz, nem tenho mais as alterações e já nem importa mais.
Também fucei no código de um certo CMS fazendo um hacking (damn f*cked word) que adiantou [*****] por causa do código mudar demais e as coisas ficarem depreciadas e bugadas de modo extremamente rápido. Não tive saco.

----------------------------------------------------------------------------------------------------------------
Nem direita, nem esquerda. Quando se trata de corrupção o Brasil é ambidestro.
(anônimo)

Encryption works. Properly implemented strong crypto systems are one of the few things that you can rely on. Unfortunately, endpoint security is so terrifically weak that NSA can frequently find ways around it. — Edward Snowden







Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner
Linux banner
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts